Click here to Skip to main content
15,890,399 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: javascript for dropdownlist...... Pin
Imran Khan Pathan17-Jul-07 19:00
Imran Khan Pathan17-Jul-07 19:00 
Questionresizing table column Pin
ankur123417-Jul-07 17:45
ankur123417-Jul-07 17:45 
AnswerRe: resizing table column Pin
N a v a n e e t h17-Jul-07 18:20
N a v a n e e t h17-Jul-07 18:20 
GeneralRe: resizing table column Pin
sidbaruah17-Jul-07 18:26
sidbaruah17-Jul-07 18:26 
Question_avascript instead of javascript Pin
Scent of a Knight17-Jul-07 14:40
Scent of a Knight17-Jul-07 14:40 
AnswerRe: _avascript instead of javascript Pin
Amit Kumar G17-Jul-07 14:47
Amit Kumar G17-Jul-07 14:47 
QuestionWebsitemap/Repeater Control Pin
Amit Kumar G17-Jul-07 14:10
Amit Kumar G17-Jul-07 14:10 
QuestionHandle MaxRequestLength error Pin
kjosh17-Jul-07 12:07
kjosh17-Jul-07 12:07 
Hi,

In order to handle the error i.e page cannot be dsplayed when we upload file size more than 4 mb using Fileupload control: Iam writing the following code in Global.asax file:

void Application_Error(object sender, EventArgs e)

{

// Code that runs when an unhandled error occurs

// Fires when an error occurs Check to see whether we came from the upload form

string fn=System.IO.Path.GetFileName(Request.Path).ToString();

if ( fn== "default.aspx")

{

//Get error details

System.Exception appException=Server.GetLastError();

HttpException checkException=(HttpException) appException;

//Verfy the expected error

int code = checkException.GetHttpCode();



if((code==500) ||(checkException.ErrorCode==-2147467259))

{


// Error 400 = bad request, user

// tried to upload a file that's too large

Session["ImageTooLarge"] = 1;

Server.ClearError();

//Go to the original target page

Response.Redirect("default.aspx");

}

}

and in the Default.aspx page load is like this:

if (!IsPostBack)

{



// Check to see whether we were redirected from the error page

int i=Convert.ToInt32(Session["ImageTooLarge"]);

if (i==1)

{

lblTooLarge.Text = "Exceeded";



}

but still I am getting page not displayed error. When I try to debugg the Application_Error event is firing in that event it is storing 1 into session, but the page is not redirecting to Default.aspx page.

What I am doing wrong.

Thanks in advance.

AnswerRe: Handle MaxRequestLength error Pin
Venkatesh Mookkan17-Jul-07 16:26
Venkatesh Mookkan17-Jul-07 16:26 
Questionupload Pin
raquidd2217-Jul-07 11:54
raquidd2217-Jul-07 11:54 
Questionasp.net2/c# - skinned controls using themes Pin
foolios17-Jul-07 10:13
foolios17-Jul-07 10:13 
QuestionRemove lines from Gridview Pin
kjosh17-Jul-07 9:12
kjosh17-Jul-07 9:12 
AnswerRe: Remove lines from Gridview Pin
Tarakeshwar Reddy17-Jul-07 10:05
professionalTarakeshwar Reddy17-Jul-07 10:05 
QuestionHow to implement Audio Mixing on WebApplication Pin
raturi_raj17-Jul-07 8:29
raturi_raj17-Jul-07 8:29 
QuestionCall c# function in javascript tag Pin
keyboard warrior17-Jul-07 7:39
keyboard warrior17-Jul-07 7:39 
AnswerRe: Call c# function in javascript tag Pin
kubben17-Jul-07 8:09
kubben17-Jul-07 8:09 
Questionalert ,confirmation for a button click Pin
Archu13617-Jul-07 6:49
Archu13617-Jul-07 6:49 
AnswerRe: alert ,confirmation for a button click Pin
Vasudevan Deepak Kumar17-Jul-07 7:00
Vasudevan Deepak Kumar17-Jul-07 7:00 
GeneralRe: alert ,confirmation for a button click Pin
Archu13617-Jul-07 7:24
Archu13617-Jul-07 7:24 
Generalpls help me in this its very urgent Pin
leckey17-Jul-07 9:31
leckey17-Jul-07 9:31 
GeneralRe: alert ,confirmation for a button click Pin
sidbaruah17-Jul-07 18:38
sidbaruah17-Jul-07 18:38 
QuestionShow link button on the Last row of Gridview only Pin
kjosh17-Jul-07 6:47
kjosh17-Jul-07 6:47 
AnswerRe: Show link button on the Last row of Gridview only Pin
kubben17-Jul-07 8:12
kubben17-Jul-07 8:12 
AnswerRe: Show link button on the Last row of Gridview only Pin
ballameharmurali17-Jul-07 20:05
ballameharmurali17-Jul-07 20:05 
QuestionCollapsible Panel Pin
kjosh17-Jul-07 6:15
kjosh17-Jul-07 6:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.