Search Results

Search found 53463 results on 2139 pages for 'net generics'.

Page 122/2139 | < Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >

  • ASP.NET Download All Files as Zip

    - by Ronnie Overby
    I have a folder on my web server that has hundreds of mp3 files in it. I would like to provide the option for a user to download a zipped archive of every mp3 in the directory from a web page. I want to compress the files programmatically only when needed. Because the zip file will be quite large, I am thinking that I will need to send the zip file to the response stream as it is being zipped, for performance reasons. Is this possible? How can I do it?

    Read the article

  • VB.net Regex Get Information

    - by xzerox
    Well I am currently trying to get the word/text in between these 2 things : and ! I tried this Dim nick As String = String.Empty Dim p = ":(?<ircnick>.*?)!" Dim Matches = Regex.Matches(mail, p, RegexOptions.IgnoreCase Or RegexOptions.Singleline) If Matches IsNot Nothing AndAlso Matches.Count > 0 Then For Each Match As Match In Matches If Match.Groups("info").Success Then nick = (Match.Groups("ircnick").Value) End If Next End If It doesn't display anything. If you guys can fix this code for me I would be happy :D.

    Read the article

  • .net clipboard metadata (or whatever skype quotations use)

    - by Cyclone
    Is it possible to use the Clipboard class to grab all the data from the clipboard, like full skype quotes? They use some kind of metadata I think, which is how it knows when something is a quote or not. How can I access that from the Clipboard class? What functions would I call to set/restore Skype quotations? Thanks for the help!

    Read the article

  • How to get ID of EditorFor with nested viewmodels in asp.net mvc 2

    - by Luke
    So I have two nested view models, CreditCard - BillAddress. I have a view, "EditBilling", that has EditorFor(CreditCard). The CreditCard EditorTemplate has EditorFor(BillAddress), and the BillAddress EditorTemplate has EditorFor(BillState). The end result is a select list with id "CreditCard_BillAddress_BillState". I need to reference this in javascript, thus need to know the ID. In other situations, with non-nested ViewModels, I have used the following code: $('#<%= ViewData.ModelMetadata.PropertyName %>_BillState') The problem here is that the ModelMetadata.PropertyName property is only aware of the current property, not the parent(s). So I end up with the following: $('#BillAddress_BillState') How does one go about getting the client ID of nested strongly typed helpers? Thanks in advance.

    Read the article

  • outputting html in runtime in asp.net

    - by madness800
    Hi all, I'm building a website at the moment, I've some html fragment that is being stored into the database, I've been reading around that inserting HTML at runtime poses security risks by using the InnerHTML property of any html tag with runat server on it. So, my question is there any alternative way to safely display the html code and won't pose security risks and is it best to assume any textboxes on any given page is dangerous and process the text in the textboxes with Server.HtmlEncode before I store it to database? Cheers

    Read the article

  • Deploying ASP.NET MVC to IIS6: pages are just blank

    - by BryanGrimes
    I have an MVC app that is actually on a couple other servers but I didn't do the deploy. For this deploy I have added the wildcard to aspnet_isapi.dll which has gotten rid of the 404 error. But the pages are not pulling up, rather everything is just blank. I can't seem to find any IIS configuration differences. The Global asax.cs file does have routing defined, but as I've seen on a working server, that file isn't just hanging out in the root or anything so obvious. What could I be missing here? All of the servers are running IIS6 and I have compared the setups and they look the same to me at this point. Thanks... Bryan EDIT for the comments thus far: I've looked in the event logs with no luck, and scoured various IIS logs per David Wang: blogs.msdn.com. Below is the Global.asax.cs file... public class MvcApplication : System.Web.HttpApplication { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("error.axd"); // for Elmah // For deployment to IIS6 routes.Add(new Route ( "{controller}.mvc/{action}/{id}", new RouteValueDictionary(new { action = "Index", id = (string)null }), new MvcRouteHandler() )); routes.MapRoute( "WeeklyTimeSave", "Time/Save", new { controller = "Time", action = "Save" } ); routes.MapRoute( "WeeklyTimeAdd", "Time/Add", new { controller = "Time", action = "Add" } ); routes.MapRoute( "WeeklyTimeEdit", "Time/Edit/{id}", new { controller = "Time", action = "Edit", id = "" } ); routes.MapRoute( "FromSalesforce", "Home/{id}", new { controller = "Home", action = "Index", id = "" }); routes.MapRoute( "Default2", "{controller}/{id}", new { controller = "Home", action = "Index", id = "" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); } protected void Application_Start() { RegisterRoutes(RouteTable.Routes); } } Maybe this is as stupid as the asax file not being somewhere it needs to be, but heck if I know at this point.

    Read the article

  • URLRewriter.net with multiple querystring separated by /

    - by Andreas Strandfelt
    I have been looking around the site a bit, but I didn't find any replies on how to do it the way I want. What I want is an URL like this: www.example.com/Projects/"querystring1 - text only"/"querystring2 - 4 digits only"/ to show the page with this URL: www.example.com/Projects.aspx?Region=querystring1&Zip=querystring2 What I have been trying is the following: <rewrite url="~/Leje-og-udlejning-arbejdskraft/(.+)/(.+)" to="~/Workers.aspx?Region=$1&amp;zip=$2"/> But it just takes both of them as one querysting and put them in the Region-querystring.

    Read the article

  • Dynamically Adding Multiple User Controls vb.net

    - by Jamie Hartnoll
    I have a User Control which returns a table of data, which in some cases needs to be looped, displaying one on top of another. I am able to dynamically add a single instance of this by placing a fixed placeholder in the page. I am now trying to work out how to add more than one, given that I don't know how many might be needed I don't want to hard code the Placeholders. I've tried the following, but I am just getting one instance, presumably the first is being overwritten by the second My HTML <div id="showHere" runt="server"/> VB Dim thisPh As New PlaceHolder thisPh.Controls.Add(showTable) showHere.Controls.Add(thisPh) Dim anotherPh As New PlaceHolder anotherPh .Controls.Add(showTable) showHere.Controls.Add(anotherPh) How do I make it add repeated tables within the showHere div?

    Read the article

  • Connection Timeout exception for a query using ADO.Net

    - by dragon
    Update: Looks like the query does not throw any timeout. The connection is timing out. This is a sample code for executing a query. Sometimes, while executing time consuming queries, it throws a timeout exception. I cannot use any of these techniques: 1) Increase timeout. 2) Run it asynchronously with a callback. This needs to run in a synchronous manner. please suggest any other techinques to keep the connection alive while executing a time consuming query? private static void CreateCommand(string queryString, string connectionString) { using (SqlConnection connection = new SqlConnection( connectionString)) { SqlCommand command = new SqlCommand(queryString, connection); command.Connection.Open(); command.ExecuteNonQuery(); } }

    Read the article

  • asp.net mvc and portal like functionality

    - by richard-heesbeen
    fHi, I need to build an site with some portal like functionality where an param in the request will indentify the portal. like so http:/domain/controller/action/portal Now my problem is if an portal doesn't exists there must be an redirect to an other site/page and an user can login in to one portal but if the user comes to an other portal the user must be redirected back to the login page for that portal. I have something working now, but i feel like there must be an central place in the pipeline to handle this. My current solution uses an custom action filter which checks the portal param and sees if the portal exists and checks if the user logged on in that portal (the portal the user logged on for is in the authentication cookie). I make my own IIndentiy and IPrincipal in the application_postauthentication event. I have 2 problems with my current approach: 1: It's not really enforced, i have to add the attributes to all controllers and/or actions. 2: The isauthenticated on an user isn't really working, i would like that to work. But for that i need to have access to the params of the route when i create my IPrincipal/IIndenty and i can't seem to find an correct place to do that. Hope someone can give me some pointers, Richard.

    Read the article

  • How to resolve conflicting assemblies in .Net?

    - by Amitabh
    In my web application I am using NHibernate.dll. This has a dependency on folowing assembly. 'Antlr3.Runtime, Version=3.1.0.39271, Culture=neutral, PublicKeyToken=3a9cab8f8d22bfb7' Now in the same project for another requirement I have to introduce Antlr3.StringTemplate.dll. Which has a dependency on another version of the above assembly. If I use the version of Antlr3.Runtime.dll which satisfies NHibernate , Antlr3.StringTemplate starts complaining and vice-versa. How to resolve a situation like this?

    Read the article

  • overriding Method asp.net mvc

    - by parminder
    Hi Experts, Can I override an ActionResult method. Say I have a method Index in AccountController like this public ActionResult Index() { return View(); } Can I have one more method with same name but with differnt parameters like public ActionResult Index(int userid) { return View(); } what will be the entries in the global.asax Regards Parminder

    Read the article

  • ASP.NET MVC 2 strange behavior

    - by Voice
    Hi Recently I installed VS 2010 Release (migrated from RC) and my MVC application is not working anymore. More concrete: I have a wizard with several steps for new customer account creation (Jquery form wizard, but it doesn't really matter). Each step contains a typed partial View for each part of account: Company, Customer, Licence, etc. When I submit the form I see really strange thing in ModelState. There are duplicate keys for Company: with "Company" prefix and without it. Something like this: [6] "Company.Phone" string [12] "Phone" string My model state for all these keys is not valid because Company is actually null and validation fails. When it was RC there were no such keys with "Company" prefix. So these keys in ModelState with prefix "Company" appeared after I installed VS Release. Here is my code: Main View <div id="registerSteps"> <div id="firstStep" class="step"> <fieldset> <legend><%=Html.Encode(Register.CustomerInfo) %></legend> <% Html.RenderPartial("CustomerInfo", ViewData["newCust"]); %> </fieldset> </div> <div id="secondStep" class="step"> <fieldset> <legend><%=Html.Encode(Register.CompanyInfo) %></legend> <% Html.RenderPartial("CompanyInfo", ViewData["newComp"]); %> </fieldset> </div> <div id="thirdStep" class="step"> <fieldset> <legend><%=Html.Encode(Register.LicenceInfo) %></legend> <% Html.RenderPartial("LicenceInfo", ViewData["newLic"]); %> </fieldset> </div> <div id="lastStep" class="step"> <fieldset> <legend><%=Html.Encode(Register.PrivacyStatement) %></legend> <% Html.RenderPartial("PrivacyStatementInfo"); %> </fieldset> </div> <div id="registerNavigation"> <input class="navigation_button" value="Back" type="reset"/> <input class="navigation_button" value="Next" type="submit"/> </div> </div> Two partial views (to show that they are actually identical): Company: <div id="dCompanyInfo"> <div> <div> <%=Html.LocalizableLabelFor(company => company.Name, Register.CompanyName) %> </div> <div> <%=Html.TextBoxFor(company => company.Name) %> <%=Html.ValidationMessageFor(company => company.Name) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(company => company.Phone, Register.Phone) %> </div> <div> <%=Html.TextBoxFor(company => company.Phone) %> <%=Html.ValidationMessageFor(company => company.Phone) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(company => company.Fax, Register.Fax) %> </div> <div> <%=Html.TextBoxFor(company => company.Fax) %> <%=Html.ValidationMessageFor(company => company.Fax) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(company => company.Size_ID, Register.CompanySize) %> </div> <div> <%=Html.ValueListDropDown(company => company.Size_ID, (CodeRoad.AQua.DomainModel.ValueList)ViewData["CompSize"], (string)ViewData["Culture"]) %> <%=Html.ValidationMessageFor(company => company.Size_ID) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(company => company.Industry_ID, Register.Industry) %> </div> <div> <%=Html.ValueListDropDown(company => company.Industry_ID, (CodeRoad.AQua.DomainModel.ValueList)ViewData["Industry"], (string)ViewData["Culture"]) %> <%=Html.ValidationMessageFor(company => company.Industry_ID) %> </div> </div> </div> And for Customer <div id="dCustomerInfo"> <div> <div> <%=Html.LocalizableLabelFor(customer => customer.Email, Register.Email) %> </div> <div> <%=Html.TextBoxFor(customer => customer.Email) %> <%=Html.ValidationMessageFor(customer => customer.Email) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(customer => customer.Male, Register.Gender) %> </div> <div> <%=Html.ListBoolEditor(customer => customer.Male, Register.Male, Register.Female, Register.GenderOptionLabel) %> <%=Html.ValidationMessageFor(customer => customer.Male) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(customer => customer.FirstName, Register.FirstName) %> </div> <div> <%=Html.TextBoxFor(customer => customer.FirstName) %> <%=Html.ValidationMessageFor(customer => customer.FirstName) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(customer => customer.LastName, Register.LastName) %> </div> <div> <%=Html.TextBoxFor(customer => customer.LastName) %> <%=Html.ValidationMessageFor(customer => customer.LastName) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(customer => customer.Role_ID, Register.Role) %> </div> <div> <%=Html.ValueListDropDown(customer => customer.Role_ID, (CodeRoad.AQua.DomainModel.ValueList)ViewData["OrgRole"], (string)ViewData["Culture"]) %> <%=Html.ValidationMessageFor(customer => customer.Role_ID) %> </div> </div> </div> There are some home made extension methods, but they worked pretty well in previous version (VS RC). Html which is generated is also ok, no "Company.Phone"-like stuff. So I wonder, where all these keys with "Company" came from and what can I do with that? I appreciate any solution.

    Read the article

  • Why doesn't this (translated) VB.NET code work?

    - by ropstah
    I had a piece of C# code converted, but the translated code isn't valid... Can somebody help out? C# <table> <% Html.Repeater<Hobby>("Hobbies", "row", "row-alt", (hobby, css) => { %> <tr class="<%= css %>"> <td><%= hobby.Title%></td> </tr> <% }); %> </table> VB <% Html.Repeater(of Jrc3.BLL.Product)(Model.ProductCollectionByPrcAutoKey, "row", "row-alt", Function(product, css) Do %> <tr class="<%= css %>"> <td><%= hobby.Title%></td> </tr> <% End Function)%>

    Read the article

  • VB.net Insert Environment.NewLine at 20 characters.

    - by xzerox
    Well I have been able to figure this out but what I want to do is make my string have a new line after 20 chars. I know how to find how many chars the string has but not how to insert environment.newline at 20 chars. I am using this to find the string length If string.Length > 20 then 'Need to be able to insert environment.newline at 20 chars Else 'Normal string End If

    Read the article

  • Reusing controllers in different web sites with asp.net mvc

    - by Alfredo Fernández
    Hello, I'm creating a content management for a kind of Enterprises, lets say for example, pets shops. Thats my projects structure: PetShopModel PetShopControllers PetShopWeb1 PetShopWeb2 PetShopWeb3 The structure is that since each client would have different specifications. Its that a good choice? or there are better solutions? Thanks in advance and sorry about my english!

    Read the article

  • ASP.NET MVC vs. WebForms - a simple question

    - by Tony
    Hi, I'm wondering about one thing - as we know, the MVC pattern is stateless (it doesn't use the ViewState, so we use only HTML controls), but if we use them in WebForms as well, it'll become stateless too ? so, by doing this, we are getting closer to the MVC pattern ?

    Read the article

  • Using .net Datetime in sql query

    - by Patrick
    I have a DateTime object I want to compare against an sql datetime field in a where clause. I'm currently using: "where (convert( dateTime, '" & datetimeVariable.ToString & "',103) <= DatetimeField)" But I believe datetimeVariable.ToString will return a different value depending on the culture where the system is running. How would you handle this so it is culture independent?

    Read the article

  • File Upload in asp.net

    - by vaibhav
    I am using FileUpload control to facilitate Image file upload on my website. I want to restrict a user to upload only Image file. I am using if (fupFirmLogo.PostedFile.ContentType == "image/Jpeg") { } to check if the file is a image or not. I want to allow all image extensions like PNG, GiF, Jpeg, tif , BMP etc. How should I do it.

    Read the article

  • APS.NET MVC Ajax: Passing a IList from the View to the Controller

    - by Bpimenta
    I need to pass the grid rows from the view to the controller using POST. The idea is to pass an IList of objects (people) that have the following structure: String Name String Address String ID I want to read the data from the JQGrid and pass it to the controller to fill the IList. I'm trying to build the data object to pass through the Ajax data parameter. Here is the Javascript code: $("#saveButton").click( function() { var returnData = '{'; var existingIDs = $('#listPeople').getDataIDs(); if (idsPeople.length > 0) { for (i=0;i<idsPeople.length;i++) { //Trying to build the obejct data ret = ret + '"people['+ i +'].Name":' $('#listPeople').getRowData(idsPeople[i]).Name + ','; ret = ret + '"people['+ i +'].Address":' $('#listPeople').getRowData(idsPeople[i]).Address+ ','; ret = ret + '"people['+ i +'].Id":' $('#listPeople').getRowData(idsPeople[i]).Id+ ','; //If it has more than one element if (idsPeople.length>1 && (i+1)<idsPeople.length) { ret = ret + ','; } } } ret = ret + '}'; My Ajax function for sending: var url_all = '<%=Url.Action("SaveData") %>; $.ajax({ type: "POST", url: url_all, data: ret, dataType: "json", success: function(){ alert("OK"); }, error: function(){ alert("Error: check SaveData"); } }); My controller: public ActionResult SaveData(IList<PeopleHeader> people){ // using debug to know if "people" variable has any values return Json(true); } The problem I'm getting is an error: "System.NotSupportedException: Fixed size collection", and no data is being delivered. I think my problem relies on creating the object... is there any simpler way of doing this procedure? Thanks in advance,

    Read the article

< Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >