Change Global DateTime Format of asp.net web application using webconfig

24. March 2020

In order to change the global setting of Date Time Format from webconfig, you will have to include the globalization tag with culture being the country and language you want to set . For complete list of culture values please follow this link
https://www.basicdatepicker.com/samples/cultureinfo.aspx

<system.web>

  <globalization culture="en-GB"/>

ASP.NET, ASP.NET MVC, webconfig

Change Global DateTime Format of asp.net web application using webconfig

24. March 2020

In order to change the global setting of Date Time Format from webconfig, you will have to include the globalization tag with culture being the country and language you want to set . For complete list of culture values please follow this link https://www.basicdatepicker.com/samples/cultureinfo.aspx



<system.web> <globalization culture="en-GB"/>

ASP.NET, ASP.NET MVC, webconfig

Login.DestinationPageUrl does not work for me

4. July 2013

Login.DestinationPageUrl does not work for me

 Whenever i try to login , this control redirects to the page requested on the first place after logging in even though i have mentioned which page to open after user is logged in . Following is the solution to this :

protected void Login1_LoggedIn(object sender, EventArgs e) 

{ 

  Response.Redirect(ResolveClientUrl(Login1.DestinationPageUrl));

}

ASP.NET, C# ,

Updatepanel gives full postback instead of asyncpostback When using Dropdownlist inside listview inside Updatepanel

19. March 2013

Updatepanel gives full postback instead of asyncpostback When using Dropdownlist inside listview inside Updatepanel . This Problem i faced when i had a listview which dynamically gets items and populates itemtemplate with dropdownlists . I had this listview inside an updatepanel and when selectionchanged event fires a complete postback was fired .

Solution to this problem i found out at this link http://stackoverflow.com/questions/4319156/updatepanel-gives-full-postback-instead-of-asyncpostback

OR

you can directly add ClientIDMode="AutoID"in listview

 

 

ASP.NET ,

After logout, back button in browser should not open the secured page visited earlier.

7. March 2013

Solution to this problem is
We have to add these four lines in every page ( which you want to make not cacheable ) . I have added these lines in Masterpage on OnInit() function.

protected override void OnInit(EventArgs e)
{
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetAllowResponseInBrowserHistory(false);
Response.Cache.SetNoStore();
base.OnInit(e);
}

ASP.NET ,

Suddenly my controls stop working and postback was fired when clicking buttons

1. March 2013

Suddenly my controls stop working and no postback was fired when buttons clicked . This problem occurred because i added  by mistake some html code in my form which included its own form hence my already working controls stopped .

ASP.NET

System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client

27. February 2013

This error comes when you try to get user input in raw html through a textbox control in order to resolve this you will have to include ValidateRequest="false"

in

<%@ Page Title="" ValidateRequest="false" Language="C#" MasterPageFile="" AutoEventWireup="true" CodeBehind="" Inherits="" %>

and also you will have to include this

<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime requestValidationMode="2.0"/>
</system.web>
</configuration> 

in your web.config file

ASP.NET