Click here to Skip to main content
15,917,641 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Need help impersonating a user Pin
dalge20-Nov-07 5:28
dalge20-Nov-07 5:28 
GeneralRe: Need help impersonating a user Pin
Pete O'Hanlon20-Nov-07 11:19
mvePete O'Hanlon20-Nov-07 11:19 
QuestionAJAX Confirm Button Extender Pin
Sarfaraj Ahmed20-Nov-07 5:12
Sarfaraj Ahmed20-Nov-07 5:12 
AnswerRe: AJAX Confirm Button Extender Pin
M_Menon20-Nov-07 6:13
M_Menon20-Nov-07 6:13 
GeneralRe: AJAX Confirm Button Extender Pin
Sarfaraj Ahmed20-Nov-07 6:28
Sarfaraj Ahmed20-Nov-07 6:28 
AnswerRe: AJAX Confirm Button Extender Pin
SABhatti20-Nov-07 6:40
SABhatti20-Nov-07 6:40 
GeneralRe: AJAX Confirm Button Extender Pin
Sarfaraj Ahmed20-Nov-07 8:29
Sarfaraj Ahmed20-Nov-07 8:29 
AnswerRe: AJAX Confirm Button Extender Pin
SABhatti20-Nov-07 10:30
SABhatti20-Nov-07 10:30 
Sarfraj you and I are not on same page. The code I suggested was to validate the form on the client using javascript, not on the server. From your code it seems that you are validating the form on the server side. If you want to do this way, I'll suggest the following:

Add a panel in the aspx page like this below lblmessage:

<asp:panel id="pnlYesNo" runat="Server" visible="false">
<asp:button runat="server" id="btnYes" text="Yes" />
<asp:button runat="server" id="btnNo" text="No" />
</asp:panel>

change your code as under:

If Not _CheckingForm = 0 Then
pnlYesNo.visible = true
lblmessage.text = "Are you sure you want add this book information?"
else
lblmessage.text= "Please Check Your Input Value"
pnlYesNo.visible = false
end if

Now in click event of No button, you will hide the panel like:

Protected Sub btnNo_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnNo.Click
pnlYesNo.visible = false;
lblmessage.text ="whatever you want"
End Sub

and in click event of Yes do this:

Protected Sub btnYes_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnYes.Click
// validate the form again in case user might have changed something
Dim _CheckingForm As Integer = CheckingFormForAddingBooks()

If Not _CheckingForm = 0 Then
// save the book info, display the message and clear the form
Else
// invalid values so display the message
lblmessage.text= "Please Check Your Input Value"
End If
End Sub

----- code for my previous solution

And, if you want to follow my previous code then you have to do this:

In pageload function do this:
<code>

ibtnAddNewBooks.Attributes.Add("OnClick", "javascript:return validateAndSubmit();")

</code>

now whatever you are doing in CheckingFormForAddingBooks function you will have to convert it to javascript and do it validateAndSubmit function. And on the server side in ibtnAddNewBooks_Click function you will save the books and display successful message.

-----
QuestionSettings is not a member of my Pin
JMUREKEZI20-Nov-07 4:58
JMUREKEZI20-Nov-07 4:58 
AnswerRe: Settings is not a member of my Pin
Not Active20-Nov-07 11:47
mentorNot Active20-Nov-07 11:47 
GeneralRe: Settings is not a member of my Pin
JMUREKEZI21-Nov-07 4:02
JMUREKEZI21-Nov-07 4:02 
QuestionExecute a SSIS package from aspx Pin
srinandan..20-Nov-07 4:04
srinandan..20-Nov-07 4:04 
AnswerRe: Execute a SSIS package from aspx Pin
Michael Sync20-Nov-07 4:52
Michael Sync20-Nov-07 4:52 
QuestionWebconfig + SQL Server 2003 Pin
Ibuprofen20-Nov-07 3:37
Ibuprofen20-Nov-07 3:37 
AnswerRe: Webconfig + SQL Server 2003 Pin
Michael Sync20-Nov-07 4:43
Michael Sync20-Nov-07 4:43 
GeneralRe: Webconfig + SQL Server 2003 Pin
Ibuprofen21-Nov-07 4:26
Ibuprofen21-Nov-07 4:26 
QuestionReport Problem Pin
macca2420-Nov-07 3:30
macca2420-Nov-07 3:30 
AnswerRe: Report Problem Pin
Michael Sync20-Nov-07 4:54
Michael Sync20-Nov-07 4:54 
AnswerRe: Report Problem Pin
Gandalf_TheWhite20-Nov-07 18:19
professionalGandalf_TheWhite20-Nov-07 18:19 
GeneralRe: Report Problem Pin
macca2420-Nov-07 22:15
macca2420-Nov-07 22:15 
Questionjavascript problem in simulate tab menu???? Pin
mr.mohsen20-Nov-07 3:25
mr.mohsen20-Nov-07 3:25 
AnswerRe: javascript problem in simulate tab menu???? Pin
Michael Sync20-Nov-07 4:22
Michael Sync20-Nov-07 4:22 
Questiondelegates Pin
Sonia Gupta20-Nov-07 3:10
Sonia Gupta20-Nov-07 3:10 
AnswerRe: delegates Pin
N a v a n e e t h20-Nov-07 3:25
N a v a n e e t h20-Nov-07 3:25 
QuestionGridView Control Question Pin
kenexcelon20-Nov-07 3:03
kenexcelon20-Nov-07 3:03 

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.