Click here to Skip to main content
16,005,206 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: newbie help Pin
Not Active14-Nov-06 8:33
mentorNot Active14-Nov-06 8:33 
AnswerRe: newbie help Pin
Grapes-R-Fun14-Nov-06 8:54
Grapes-R-Fun14-Nov-06 8:54 
GeneralRe: newbie help Pin
ozeegers14-Nov-06 11:04
ozeegers14-Nov-06 11:04 
QuestionRe: newbie help Pin
Grapes-R-Fun14-Nov-06 16:31
Grapes-R-Fun14-Nov-06 16:31 
AnswerRe: newbie help Pin
ozeegers15-Nov-06 1:49
ozeegers15-Nov-06 1:49 
AnswerRe: newbie help Pin
ozeegers16-Nov-06 11:37
ozeegers16-Nov-06 11:37 
GeneralRe: newbie help Pin
Grapes-R-Fun16-Nov-06 16:05
Grapes-R-Fun16-Nov-06 16:05 
GeneralRe: newbie help Pin
Grapes-R-Fun17-Nov-06 2:23
Grapes-R-Fun17-Nov-06 2:23 
At this point, you would have two pages; the main page (with the pop-up button and all) and the pop-up page (where you store your session variables, and have close button).

STEP1:
In your main page, drag and drop either an HTML button or an asp control that doesn't trigger a post back, such as a label. If you want to use the HTML button, make sure you give it a proper ID and runat="server". Once you did that, write the below code within your pageload event:

<br />
yourLabel.Attributes.Add("onclick", "window.showModalDialog('/yourPath/popup.aspx', null, 'status:no; dialogWidth:360px; dialogHeight:229px; help:no; scroll:no; menubar:no; resizable:no')");<br />

---OR---
<br />
yourHTMLbutton.Attributes.Add("onclick", "window.showModalDialog('/yourPath/popup.aspx', null, 'status:no; dialogWidth:360px; dialogHeight:229px; help:no; scroll:no; menubar:no; resizable:no')");<br />

VERY IMPORTANT- make sure you put this code here:
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
	  if (!Page.IsPostBack)<br />
        {<br />
           //your code goes here<br />
        }<br />
<br />
}<br />

STEP2:
Now, its time for you to write code in your pop-up page. Do all your processing, and then store your result(s) in session object(s):
<br />
Session["yourVariable"] = _someLocalVariable;<br />
Session.Timeout = 10; //in minutes<br />

Then, create a button on your pop-up page, and write the following code for it:
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
	  if (!Page.IsPostBack)<br />
        {<br />
           closeButton.Attributes.Add("onclick", "window.close();");<br />
        }<br />
<br />
}<br />

STEP3:
The last step is to retrieve the data from pop-up and continue the process in main page:
<br />
_mainPageVariable = (Session["yourVariable"]).ToString(); //if the local variable is a string<br />

Again, make sure you type-cast correctly. If _mainPageVariable is an integer, then your code would be something like this:
<br />
_mainPageVariable = Int32.Parse((Session["yourVariable"]).ToString());<br />


Let me know if you need any help understanding my C# gibbrish Smile | :)

Nila

GeneralRe: newbie help Pin
ozeegers18-Nov-06 6:25
ozeegers18-Nov-06 6:25 
GeneralRe: newbie help Pin
Grapes-R-Fun27-Nov-06 4:41
Grapes-R-Fun27-Nov-06 4:41 
GeneralRe: newbie help Pin
ozeegers19-Nov-06 0:47
ozeegers19-Nov-06 0:47 
GeneralRe: newbie help Pin
Grapes-R-Fun27-Nov-06 4:35
Grapes-R-Fun27-Nov-06 4:35 
GeneralRe: newbie help Pin
Grapes-R-Fun28-Nov-06 3:18
Grapes-R-Fun28-Nov-06 3:18 
QuestionHow to be a good member of the discussion board Pin
ednrgc14-Nov-06 7:25
ednrgc14-Nov-06 7:25 
GeneralRe: How to be a good member of the discussion board Pin
Guffa14-Nov-06 8:16
Guffa14-Nov-06 8:16 
GeneralRe: How to be a good member of the discussion board Pin
ednrgc14-Nov-06 8:17
ednrgc14-Nov-06 8:17 
GeneralRe: How to be a good member of the discussion board Pin
Grapes-R-Fun14-Nov-06 9:08
Grapes-R-Fun14-Nov-06 9:08 
Questionweb user control Pin
KORCARI14-Nov-06 6:46
KORCARI14-Nov-06 6:46 
AnswerRe: web user control Pin
RichardGrimmer14-Nov-06 7:10
RichardGrimmer14-Nov-06 7:10 
QuestionTable dimensions Pin
KORCARI14-Nov-06 6:17
KORCARI14-Nov-06 6:17 
AnswerRe: Table dimensions Pin
RichardGrimmer14-Nov-06 7:11
RichardGrimmer14-Nov-06 7:11 
QuestionPage Activation Pin
Ramasubramaniam14-Nov-06 4:47
Ramasubramaniam14-Nov-06 4:47 
AnswerRe: Page Activation Pin
indianet14-Nov-06 5:43
indianet14-Nov-06 5:43 
AnswerRe: Page Activation Pin
l0kke15-Nov-06 0:20
l0kke15-Nov-06 0:20 
QuestionHow Is Possible Check Row Affected Pin
marconi Flangepants14-Nov-06 4:38
marconi Flangepants14-Nov-06 4:38 

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.