CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML





Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 10/26/2007 12:45:32 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 10 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
Rynor
Asp.Net User
Passing Information Between Pages10/26/2007 12:45:32 AM

0/0

Hi everyone,

I am actually trying to solve two problems in this post, both related. I would like to start off explaining on what I am trying to accomplish. I have a main page that is using a masterpage. On that main page I have a hyperlink that uses the onclick function. The onclick function of this link opens another window using window.open("findId.aspx", "genericname", "height=400,widith=400,status=yes..etc"); In this popup window I am connecting to a database using a dategrid that gathers a bunch of numbers and a description of what each number means. What I am trying to do is allow the user to select a specific row (a specific id number). When the uses selected one of those ids I want the current popup to close and post the information back on my main page in a textbox.

 The second thing I am trying to accomplish is passing the information that is going to be placed in that text box to various other pages of my website. All the other websites are using the same masterpage as well. The masterpage just gives me a standard header,menu,contentpanel, and footer.

Please Note:

I am avoiding using session states and query strings since because that data that is being passed through each page is senstive. I was also informed that sessions are "unreliable".

Any help would be greatly appreciated!

Thanks Everyone,

Rynor

Suprotim Agarwa
Asp.Net User
Re: Passing Information Between Pages10/26/2007 5:32:00 AM

0/0

Hi,

You can use properties to store value.

Create a class MyClass. Create a method called

public static void SetValue()

{

myOwnValue = // set you value here;

}

 private Int16 myOwnValue;

    public Int16 MyOwnValue    {
        get
        {
            return myOwnValue;
        }
        set
        {
            myOwnValue= value;
        }
    }

 

In your parent form, set the value using MyClass.myOwnValue = something;

Access this value from Popup form using MyClass.MyOwnValue;

Alternatively, you can check some code written by NC01 in this post.

 

HTH,
Suprotim Agarwal

-----
http://www.dotnetcurry.com
-----

 

 

 


Don't forget to click "Mark as Answer" on the post that helped you. This will help readers to know which post solved your issue and make their search easy
Rynor
Asp.Net User
Re: Passing Information Between Pages10/26/2007 1:07:33 PM

0/0

Thanks for the information. The link you suggested takes care of the postback and setting the value. Now how would I go about on the postback from the popup to place that elements value into a textbox?

Thanks again!

Amanda Wang - M
Asp.Net User
Re: Passing Information Between Pages10/30/2007 3:43:09 AM

0/0

Hi,

Base on your description, when you close the popup window,  make the parent window postback and pass the element value into parent window's textbox, right?

You can try to use the showModalDialog, like below:

1. The parent page:

          <script language="javascript">
              <!--
             /**//**
           * @param newUrl       ModalDialog page path
            * @param wLen        ModalDialog's width
           * @param iLen        ModalDialog's height
           **/
             function OpenModalDialog(newURL,wLen,hLen)
             {
                 try
                {
                     //Open the link
                   var  recdata=showModalDialog(newURL,"DescWindow","dialogWidth:"+wLen+"px;dialogHeight:"+hLen+"px;center:1;scroll:1;help:0;status:0");

                    if(recdata != null)
                    {
                        window.document.all.txt.value = recdata;
                    }
                 }
                 catch(err)
                {}
             }
             -->
     </script>


<a href="javascript: OpenModalDialog('Default4.aspx', 700, 500)">Open the Modal Dialog</a>
<asp:TextBox ID="txt" runat="server"></asp:TextBox>

2. The child page:

<head runat="server">
    <title>Untitled Page</title>
    <script language=javascript type="text/javascript">
    function closemd()
    {
        var str = window.document.all.TextBox1.value;
        window.returnValue = str;
         window.close();
    }
    </script>
    <base target="_self">
         </head>
<body>
    <form id="Form1" method="post" runat="server">
             <asp:Button id="btnOk" runat="server" Text="OK"  OnClientClick="closemd()"></asp:Button>&nbsp;
             <INPUT type="button" value="Cancel" onclick="javascript: window.close();">
             <asp:TextBox  ID="TextBox1" runat="server"></asp:TextBox>
         </form>

Hope it helps.


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
4 Items, 1 Pages 1 |< << Go >> >|



Search This Site:


Meet Our Sponsors:



Other Resources:

Passing identity to Business Tier - advanced_asp.net.architecture - Web ... ... Items, 1 Pages | Go >> >| gallwood. Asp.Net User. Passing identity to ... sharing user controls between applications. active directory membership provider ...
ASP.NET.4GuysFromRolla.com: Passing Information Between Content and ... This article, by Scott Mitchell, explores techniques for passing information to and from ASP.NET 2.0 content pages and master pages.
Felgall Javascript - Passing Information Between Pages How to pass information between web pages. ... In this latter case you will probably need to pass information between the pages on your site. ...
Scott on Writing Passing Information Between Master Pages and Content Pages ... different techniques: Passing Information Between Content and Master Pages. ...
How to: Pass Values Between ASP.NET Web Pages ... from one ASP.NET Web page to another, you will frequently want to pass information from the source page to the target ... passing information to the next page. ...
CodeProject: Passing information between pages -The .NET way. Free ... ... demonstrates how to pass data between pages. ... Passing information between pages -The .NET ... Can you passing datasets between pages using the method ...
developerWorks : Lotus : Workplace Web Content Management : Passing ... Passing Information between content/pages. Posted: Apr 16, 2008 07:48:22 AM ... Re: Passing Information between content/pages ...
How to: Pass Values Between ASP.NET Web Pages If your application redirects (navigates) from one ASP.NET Web page to another, you will frequently want to pass information from the source page to the target ...
WSDOT - Mountain Passes Maintained by the Washington State Department of Transportation.
Passing parameters between pages Links between pages can be used to pass information from one page to another. ... make pages more general and to pass specific information between pages, enabling ...
ASP Tutorials - Herong's Tutorial Notes - ASP Sessions Different ways to pass information between requests or pages. ... Passing Values between Pages. There are many ways to pass values from one pages to the next pages: ...



 
All Times Are GMT