Populate Dataset With Table Names From Stored Procedure

Your SP is not actually returning multiple tables, its returning a selection of columns and rows from your tables, therefore there is no ‘table name’, and hence why they are named table1, table2 etc. If its important, you could return an extra column for each selection, and in that column fill it with the desired … Read more

asp.net 4.0 web forms routing – default/wildcard route

You can match all remaining routes like this: routes.MapPageRoute(“defaultRoute”, “{*value}”, “~/Missing.aspx”); In this case, we know all routes, and want to send anything else to a “missing”/404 page. Just be sure to put this as the last route, since it is a wildcard and will catch everything. Alternatively you could register a route the same … Read more

Font awesome inside asp button

You can’t with the default asp.net button you will need to use a HTML button and give it runat=server attribute: <button runat=”server” id=”btnRun” class=”btn btn-mini” title=”Search”> <i class=”icon-camera-retro”></i> Search </button> So use code behind with this you add: onserverclick=”functionName” To the button, then in your C# do: protected void functionName(object sender, EventArgs e) { Response.Write(“Hello … Read more

Check if Cookie Exists

Sometimes you still need to know if Cookie exists in Response. Then you can check if cookie key exists: HttpContext.Current.Response.Cookies.AllKeys.Contains(“myCookie”) More info can be found here. In my case I had to modify Response Cookie in Application_EndRequest method in Global.asax. If Cookie doesn’t exist I don’t touch it: string name = “myCookie”; HttpContext context = … Read more

how to remove ‘name’ attribute from server controls?

create a Filter (class that inherits from Stream), assign it to your HttpContext.Response.Filter attribute, and in it you would overwrite the Write method, to remove all the name-tags from the generated html 🙂 See this page for more information http://msdn.microsoft.com/en-us/library/system.web.httpresponse.filter.aspx Update Looking at the sourcecode for TextBox it reveals that Name is actually added to … Read more

How to fix: Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

It turns out that this is because ASP.Net was not completely installed with IIS even though I checked that box in the “Add Feature” dialog. To fix this, I simply ran the following command at the command prompt %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i If I had been on a 32 bit system, it would have looked like the … Read more