Asp.Net
In global.asax: protected void Application_BeginRequest(Ob... sender, EventArgs e) { HttpRuntimeSection runTime = (HttpRuntimeSection)WebConf... //Approx 100 Kb(for page content) size has been deducted because the maxRequestLength proprty is the page size, not only the file upload size int maxRequestLength = (runTime.MaxRequestLength - 100) * 1024; //This code is used to check the request length of the page and if the request length is greater than...
<script type="text/javascript" language="javascript"> Sys.WebForms.PageRequestMan... function refresh() { //Your code here; } </script> Source
Type myType = typeof(MyClass); string methodName = "methodNameAsString"; MethodInfo myTypeGetMethod = myType.GetMethod(methodName); MyClass obj = new MyClass(); object[] parms = { 123, "string test"}; myTypeGetMethod.Invoke(obj, args);
protected override void OnPreInit(EventArgs e) { Page.MasterPageFile = "~/LinkToMasterPage"; base.OnInit(e); } Enjoy :)
Response.Clear();Response.C... = "application/pdf";Response.... "attachment;filename=\"File... SourceEnjoy :)...
Hello, If you are reading this you probably have already realized that it is not possible to hide a column that was auto-generated using myGridView.Columns[index].V... To achieve this you must: 1 - set the OnRowCreated to execute a function, something like OnRowCreated="gridRowCreated" 2 - Create your function as such: protected void gridRowCreated(object sender, GridViewRowEventArgs e) { e.Row.Cells[yourIndexHere].... = false; } Hope this helps ;)...
A few days ago I got an error report to fix. Some web application that I now maintain was inserting duplicate records. After a quick look it became obvious that the users where double clicking the submit button and that made the page post twice and so a duplicate record would appear. A quick fix dor this problem using javascript: <script language="javascript" type="text/javascript"> var haveSubmitted=false; function FirstSubmitOnly() { if (haveSubmitted) return false; haveSubmitted = true;...
I think at some point everybody had this problem... A big form with some control that forces a postback. If you have scrolled down, the page scroll will be placed at the top. To force the aspx to keep the scroll, just place the following instrucion on the <pages> tag of your web config. <pages maintainScrollPositionOnPos... Enjoy :)
Simple how to refresh page every 60 seconds <meta http-equiv="refresh" content="60">...
Just a simple snippet to show how an aspx can be exported to Excel Response.ClearContent(); Response.Buffer = true; Response.ContentType = "application/vnd.ms-excel"; Response.AddHeader("content... "attachment; filename=" + "teste" + ".xls;charset=iso-8859-1"); StreamWriter sw = new StreamWriter(Response.Outpu... System.Text.Encoding.GetEnc... HtmlTextWriter htmlTextWriter = new HtmlTextWriter(sw); this.RenderControl(htmlText... Response.End();...
Full Asp.Net Archive