Click here to Skip to main content
16,016,613 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Submit button, onClick does not work automaticlly Pin
badgrs26-Jan-07 5:16
badgrs26-Jan-07 5:16 
GeneralRe: Submit button, onClick does not work automaticlly Pin
peshawarcoder26-Jan-07 7:15
peshawarcoder26-Jan-07 7:15 
GeneralRe: Submit button, onClick does not work automaticlly Pin
Guffa26-Jan-07 9:12
Guffa26-Jan-07 9:12 
GeneralRe: Submit button, onClick does not work automaticlly Pin
peshawarcoder26-Jan-07 7:18
peshawarcoder26-Jan-07 7:18 
GeneralRe: Submit button, onClick does not work automaticlly Pin
nour12326-Jan-07 9:55
nour12326-Jan-07 9:55 
GeneralRe: Submit button, onClick does not work automaticlly Pin
badgrs27-Jan-07 11:13
badgrs27-Jan-07 11:13 
Questionfile upload in asp.net 1.1 Pin
Pradip Kishore26-Jan-07 2:28
Pradip Kishore26-Jan-07 2:28 
AnswerRe: file upload in asp.net 1.1 Pin
NKandwal26-Jan-07 3:30
NKandwal26-Jan-07 3:30 
Define the ID of file control as FileUpload then add a Button named as btnSubmit adn write the folowing code on the Button's onclick event

private void btnSubmit_Click(object sender, System.EventArgs e)
{
try
{
if (isVaildData())
{

if (FileUpload!=null)
{

string DestinationPath = Server.MapPath("../UpLoadFile/Images").ToString() ;
string ImgName =GetUniqueId()+ System.IO.Path.GetFileName(FileUpload.PostedFile.FileName);
ImgName = ImgName.Replace(" ", "");
string saveLoaction=DestinationPath+"\\"+ImgName;
FileUpload.PostedFile.SaveAs(saveLoaction);
Session["SavedFile"]=ImgName;
btnSubmit.Enabled=false;
btnRemoveFile.Enabled=true;
lblMessage.Text="File :" + ImgName + " Uploaded Successfully ";
lblMessage1.Text=ImgName;
Session["strFileType"]=Request.QueryString["Type"].ToString().Trim();
}
else
lblMessage.Text="Please Browse a File.";
}


}
catch(Exception ex)
{
string str=ex.Message;
}

}

rivate Boolean isVaildData()
{

if (FileUpload.PostedFile.ContentLength==0)
{
lblMessage.Text="Please Select an valid file";
return false;
}

if ( FileUpload.PostedFile.FileName!="" )
{
string filename=System.IO.Path.GetFileName(FileUpload.PostedFile.FileName.ToString());
string extension = System.IO.Path.GetExtension(FileUpload.PostedFile.FileName);
string Type = Request.QueryString["Type"].ToString();

switch(extension.ToLower())
{
case ".pdf":
break;
case ".doc":
break;
case ".jpg":
break;
case ".gif":
break;
default:
{
lblMessage.Text="Invalid Disclosures file :-" + FileUpload.PostedFile.FileName;
return false;
}
}
}

return true;

}

Neeraj
GeneralRe: file upload in asp.net 1.1 Pin
Pradip Kishore28-Jan-07 18:27
Pradip Kishore28-Jan-07 18:27 
GeneralRe: file upload in asp.net 1.1 Pin
Pradip Kishore28-Jan-07 18:37
Pradip Kishore28-Jan-07 18:37 
Questionre-setting text box in webforms Pin
Pradip Kishore26-Jan-07 1:48
Pradip Kishore26-Jan-07 1:48 
GeneralRe: re-setting text box in webforms Pin
badgrs26-Jan-07 3:50
badgrs26-Jan-07 3:50 
QuestionQUERY: Client-side DataGrid for faster fluid feel? Pin
dhruba.bandopadhyay26-Jan-07 0:27
dhruba.bandopadhyay26-Jan-07 0:27 
AnswerRe: QUERY: Client-side DataGrid for faster fluid feel? Pin
badgrs26-Jan-07 3:53
badgrs26-Jan-07 3:53 
QuestionWeb programming in tiers Pin
Member 374156225-Jan-07 21:09
Member 374156225-Jan-07 21:09 
AnswerRe: Web programming in tiers Pin
Colin Angus Mackay25-Jan-07 21:30
Colin Angus Mackay25-Jan-07 21:30 
AnswerRe: Web programming in tiers Pin
badgrs26-Jan-07 3:55
badgrs26-Jan-07 3:55 
QuestionSQLDATA Source -Multiple Resultset... Pin
Amit Kumar G25-Jan-07 14:56
Amit Kumar G25-Jan-07 14:56 
AnswerRe: SQLDATA Source -Multiple Resultset... Pin
Sylvester george26-Jan-07 3:41
Sylvester george26-Jan-07 3:41 
Questionis it good to use : SqlDataSource Pin
Amit Kumar G25-Jan-07 13:34
Amit Kumar G25-Jan-07 13:34 
AnswerRe: is it good to use : SqlDataSource Pin
goradaranaresh26-Jan-07 2:41
goradaranaresh26-Jan-07 2:41 
GeneralRe: is it good to use : SqlDataSource Pin
Amit Kumar G26-Jan-07 3:40
Amit Kumar G26-Jan-07 3:40 
Questionexecuting code when the user closes the web page Pin
dipanddump25-Jan-07 12:56
dipanddump25-Jan-07 12:56 
AnswerRe: executing code when the user closes the web page Pin
Christian Graus25-Jan-07 16:10
protectorChristian Graus25-Jan-07 16:10 
AnswerRe: executing code when the user closes the web page Pin
Artem Kustikov25-Jan-07 21:08
Artem Kustikov25-Jan-07 21:08 

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.