I'm definitely missing something.
It still gave me the same behavior.
So to make sure, I used Windows 8 and Visual Studio 2012.
I created a new application and it still gave me the same behavior.
It hit Session_Start, but did not hit Application_Error.
While debugging the error is shown in Default.aspx.cs and it says SqlException was unhandled by user code and Could not find stored procedure 'StoredProcedure2'.
If I use a try...catch and re-throw the exception from the catch handler, it hits Application_Error.
Anyway, thanks for your time.
«_Superman_» I love work. It gives me something to do between weekends.
I suspected some configuration issue here because the machines were used a lot before and so installed a fresh copy of Windows 8 and Visual Studio 2012.
Now I'm able to get it to work.
Thanks for your time.
Now, since you share further steps, try to disable all code exceptions in VS:
Do Cntrl+Alt+E in Visual Studio and then uncheck all - Application_Error should get hit. I guess it does not work otherwise.
I have one query,If i use a multi-user system in that on main page there is a dashboard consider it as a grid in that grid value of xyz table is displayed.
As it is a multiuser system in that data can be inserted in that xyz table, if any user inserts data in the xyz table as soon as the user inserts the data the changes gets automatically reflected in main page dashboard.
Just like mail systems of gmail and all.
In this tutorial i will let you know how to auto refresh or update GridView using AJAX Timer and UpdatePanel in asp.net. In this it is described that how a GridView is update after a specific time set in timer control.
public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
protected void Timer1_Tick(object sender, EventArgs e)
update.Text = " Gridview Was Last Updated at " + DateTime.Now;
public void databind()
string strcon = ConfigurationManager.ConnectionStrings["con"].ConnectionString;
SqlConnection conn = new SqlConnection(strcon);
string str = "select * from dept";
SqlCommand cmd = new SqlCommand(str, conn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
GridView1.DataSource = dt;
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore, Dream. Discover.
I am getting the below error in my ASP.NET 4.0 web application:
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
I started getting this error when I added the below tag in web.config to encrypt the viewstate:
I looked for lot of solutions on aspnet forums and Internet but nothing worked. If I change the viewStateEncryptionMode to "Auto" or "Never", then the page loads fine. But that would make my application insecure and security is my prime objective.
FYI:My application is deployed on a Windows 2008 R2 server and not on a webfarm.
Any solution to solve this issue?
First, just to check the simplest solution, you aren't posting back "old" pages are you? By this I mean getting the page when the viewstateEncryptionMode is off/auto, switching the mode to on then posting back. This wide cause the error, but is unlikely Tokyo are doing this.
This problem is ringing a bell, but I can't place my finger on it. You might be suffering from this http://blogs.msdn.com/b/tom/archive/2008/03/14/validation-of-viewstate-mac-failed-error.aspx (On my mobile so can't make clickety),though this was fixed IIRC.
I am trying to create a column that will always have remaining width. However I want it consist of 3 divs as the middle div will always fill the width available where as the left and right divs will be a fixed width. The problem I have is that the middle div which has remaining width knocks the other divs onto a new line. How can I prevent this?
Appear on Left, this would be fixed width
Always be remainging width
Appear Right, this would be fixed width
something the left div will have no controls in it.
many thanks in adavance
I'm working on my mobile, so apologies in advance for the lack of formatting / example code.
In principle it's pretty simple, once you know how:
1. Create a div as a container.
2. Into the above place three divs left,right and middle in that order
3. Using CSS float the left div left and the right div. ALSO set the widths
4. Using CSS set the left margin and right margin of the middle div so
it doesn't run round the divs on the edge.
You might also need to Google cleafix if you want to support other browsers.
A round up of the above can be seen here: