Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 25th, 2007, 06:48 AM
Authorized User
 
Join Date: Sep 2007
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default Default Dynamic Dialog Box

Hi,

I'm developing an application in C# ASP.NET. I have a few tab pages in my web page. When a user clicks on a tab I want to display a dialog box asking for password then verify the password and if correct open the selected tab page.
(my tab control is asp control)

Any idea is appreciated

 
Old September 26th, 2007, 02:23 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi peace2007
on click of that tab you will open a dynamic dialog box,having userid and password textbox,on click on the submit button in the dialog box send request (alternatively u can choose ajax) and if success then show the selected tab.

Hope this will help you

Cheers :)

vinod
 
Old September 26th, 2007, 05:35 AM
Authorized User
 
Join Date: Sep 2007
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply and sorry that I hadn't explained my problem well
Actually, I'm opening a dialog box using javascript but cannot return the value from that box into code behind page, because, many users may concurrently press a tab page so the return value cannot be distinguished. On the other hand, if I return the value to server.aspx I have to reload the page which I don't want.

 
Old September 26th, 2007, 08:23 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi Peace2007!!

Great:)
 you are using inbuilt dialog box(modal dialog) which is part of the main page too.

wht do u mean by "many users may concurrently press a tab page so the return value cannot be distinguished."??
offcourse this is not the case.every request is separate one ,you can distinguish those too.

hope this link will help you
great link
http://javascript.about.com/library/blmodald1.htm

http://www.netnewsgroups.net/group/m...opic34255.aspx


excellent one,i like it
http://www.codeproject.com/aspnet/mo...select=1795918


Since you don't want to reload the main page

1>user modal dialog, get the value of loginid/pwd
  on click of the button you can use ajax/iframe so that you send the login/pwd and validates it ,
 after getting response frm the server ,you can set the visibility of tab2<since u don't want to reload the page>

2>just open a div/span tag and make a form having loginid/pwd and submit button,
  on click of the button you can use ajax/iframe so that you send the login/pwd and validates it ,
 after getting response frm the server ,you can set the visibility of tab2<since u don't want to reload the page>






Cheers :)

vinod
 
Old September 29th, 2007, 05:49 AM
Authorized User
 
Join Date: Sep 2007
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Vinod!

I'll check the code as your guidance and will let you know the result soon :)

 
Old September 29th, 2007, 11:51 PM
Friend of Wrox
 
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

I agree, if you don't want to refresh the page, then you're definitely talking about an Ajax solution. That's the only other way to talk to the server to verify the username and password.

-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
 
Old September 30th, 2007, 04:29 AM
Authorized User
 
Join Date: Sep 2007
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

so sorry but it seems I'm too beginner to get head or tail of explanations of those links
My tab control is an aspx control not a client side one so I can get control of selectTab event of it in code behind page. Now, suppose I call an Ajax function when user clicks on a new tab, then open the modal dialog from that ajax function. Then I have to return the value from that dialog boz to the axaj function and from there call a method of code behind page. This surely have to be done through server.aspx. Then there's no way except refreshing the page! Besides, when user presses on a new tab, the select tab event fires in code behind page; then how can I keep the run to that point till getting the result from server.aspx.
Could you provide me with more explanation with a sample code?


Thanks in advance,






Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX Dialog Box onlyyourspiyu Ajax 0 May 19th, 2008 08:43 AM
Dynamic Dialog Box peace2007 Ajax 1 September 26th, 2007 08:26 AM
Save As Dialog Box prasanta2expert Access VBA 0 June 23rd, 2007 07:35 AM
Dialog Box problem r_taduri ASP.NET 2.0 Professional 0 October 29th, 2006 09:33 AM
insert dialog box in a dialog box BurhanKhan Visual C++ 7 June 1st, 2004 07:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.