Click here to Skip to main content
15,916,683 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionmessagebox Pin
ankitjain111026-Aug-09 21:50
ankitjain111026-Aug-09 21:50 
AnswerRe: messagebox Pin
ankitjain111026-Aug-09 21:59
ankitjain111026-Aug-09 21:59 
GeneralRe: messagebox Pin
Coding C#26-Aug-09 22:22
Coding C#26-Aug-09 22:22 
GeneralRe: messagebox Pin
ankitjain111026-Aug-09 22:34
ankitjain111026-Aug-09 22:34 
GeneralRe: messagebox Pin
Coding C#26-Aug-09 22:39
Coding C#26-Aug-09 22:39 
GeneralRe: messagebox Pin
ankitjain111026-Aug-09 22:57
ankitjain111026-Aug-09 22:57 
GeneralRe: messagebox Pin
ankitjain111026-Aug-09 23:15
ankitjain111026-Aug-09 23:15 
QuestionHow to set CustomValidor for FileUpload Pin
shaik_mr26-Aug-09 21:27
shaik_mr26-Aug-09 21:27 
Hi,

My interface is having One, dropdownlist, some text boxes, one fileupload and a submit button..

code here..

<asp:panel id="Group1" runat="server">

<asp:dropdownlist autopostback="true" id="drp_Category" cssclass="textboxGQ_New" width="200px"
="" runat="server" onselectedindexchanged="drp_Category_SelectedIndexChanged">
<asp:listitem value="">Select Category
<asp:listitem value="Category1">Category1
<asp:listitem value="Category2">Category2
<asp:listitem value="Category3">Category3
<asp:listitem value="Category3">Category4
<asp:requiredfieldvalidator validationgroup="Group1" id="Req_drpCategory" display="None"
="" controltovalidate="drp_Category" runat="server" errormessage="Enter Category">
<cc1:validatorcalloutextender id="VCE_Category" targetcontrolid="Req_drpCategory" runat="server">


For file upload code...
------------------------

<asp:fileupload id="FileUpload1" cssclass="textboxGQ" runat="server" type="file" onkeypress="return false;">
<asp:customvalidator id="Req_FileUpload1" runat="server" errormessage="Please select file to upload"
="" controltovalidate="FileUpload1" onservervalidate="validatedrp">
<cc1:validatorcalloutextender id="Req_FileUpload1_Extender" runat="server" targetcontrolid="Req_FileUpload1">



Code behind
===========
protected void validatedrp(object source, ServerValidateEventArgs args)
{
if (drp_Category.SelectedValue == "Category1")
{
args.IsValid = true;
}
else if(drp_Category.SelectedValue == "Category3")
{
args.IsValid = true;
}
else if(drp_Category.SelectedValue == "Category2")
{
args.IsValid = false;
}
else if(drp_Category.SelectedValue == "Category4")
{
args.IsValid = false;
}
}

My issue is if i select dropdownlist item Category1 or Category3 and click the submit button, the fileupload should prompt msg as "plz select file to upload"....if i select dropdownlist item Category3 or Categroy4 and click the submit button, the fileupload should not propt msg and should redirect to different page...

plz help..

Thanks in advance
AnswerRe: How to set CustomValidor for FileUpload Pin
Ibrahim Bello27-Aug-09 1:20
Ibrahim Bello27-Aug-09 1:20 
QuestionAdding values to data gridview programmatically Pin
myinstincts26-Aug-09 21:26
myinstincts26-Aug-09 21:26 
Questionwhile using blank file , fileUpload doesn't work. Pin
Priyagdpl26-Aug-09 21:14
Priyagdpl26-Aug-09 21:14 
AnswerRe: while using blank file , fileUpload doesn't work. Pin
Arun Jacob26-Aug-09 21:33
Arun Jacob26-Aug-09 21:33 
GeneralRe: while using blank file , fileUpload doesn't work. Pin
Priyagdpl26-Aug-09 21:44
Priyagdpl26-Aug-09 21:44 
Questionthere is no source code available for the current location Pin
haleemasher26-Aug-09 21:13
haleemasher26-Aug-09 21:13 
AnswerRe: there is no source code available for the current location Pin
Arun Jacob26-Aug-09 21:22
Arun Jacob26-Aug-09 21:22 
AnswerRe: there is no source code available for the current location Pin
haleemasher26-Aug-09 21:27
haleemasher26-Aug-09 21:27 
Questionscripts in adrotator control? Pin
Member 387988126-Aug-09 21:06
Member 387988126-Aug-09 21:06 
AnswerRe: scripts in adrotator control? Pin
Arun Jacob26-Aug-09 21:10
Arun Jacob26-Aug-09 21:10 
Questionscripts in adrotator control Pin
Member 387988126-Aug-09 21:05
Member 387988126-Aug-09 21:05 
AnswerRe: scripts in adrotator control Pin
Abhishek Sur26-Aug-09 21:57
professionalAbhishek Sur26-Aug-09 21:57 
QuestionHow to Avoid Session hijacking Pin
IsamilAmeerAli26-Aug-09 21:02
IsamilAmeerAli26-Aug-09 21:02 
AnswerRe: How to Avoid Session hijacking Pin
Abhishek Sur26-Aug-09 21:43
professionalAbhishek Sur26-Aug-09 21:43 
QuestionRe: How to Avoid Session hijacking Pin
IsamilAmeerAli26-Aug-09 22:53
IsamilAmeerAli26-Aug-09 22:53 
Questionparameters to Stored procedure in ASP.net Pin
Ramakrishna GS26-Aug-09 20:54
Ramakrishna GS26-Aug-09 20:54 
AnswerRe: parameters to Stored procedure in ASP.net Pin
Arun Jacob26-Aug-09 20:59
Arun Jacob26-Aug-09 20:59 

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.