Click here to Skip to main content
15,890,882 members
Articles / Web Development / ASP.NET
Article

Passing data to popup window

Rate me:
Please Sign up or sign in to vote.
1.50/5 (3 votes)
28 Jun 2006 19.3K   12   1
Passing data to popup window without postback

Introduction

The article/code useful to pass data from webpage's codebehind to popup window.it is more interactive and it should happen without postback also. 

Using the code

In a source webpage Fromwhich we are going to pass a data to popuForm.aspx,The following example code are used in datagrid_itemcommand event to pass binded data in datagrid while clicking a linkbutton control which also be contained in datagrid.

Dim strScript As String = "popupForm.aspx?Id=" & e.Item.Cells(0).Text
strScript = "WindowOpen('" & strScript & "',800,300);"
Page.RegisterStartupScript("Email", "<script> & strScript & </script><script>" & strScript & "</script>")

Now,In the Page_load event of popupForm.aspx we can get the Id value what we passed from source webpage.

Dim getId as integer = Request.QueryString("Id")

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
India India
T.DuraiMurugan is a Software Engineer in Karnataka, India. Durai has designed and developed Microsoft Web and Windows solutions since 2003. His expertise lies in developing scalable, high-performance applications with Microsoft Enterprise Server Products in .NET technology .His core skills are ADO.NET, ASP.NET, C#, VB.NET, Web Services, XML and SQL Server.

Comments and Discussions

 
GeneralHelp with Single sign on Pin
lasertracs20-Jul-08 21:31
lasertracs20-Jul-08 21:31 
Hi all,

I trying to export my asp.net website contact in salesforce.com

I need to have an Icon(export salesforce.com) in my asp.net webpage which when I click it it should pop-up a windows prompting for username and password.after entering the login credential it should login to salesforce.com without going to the salesforce.com webpage.

So I need the code to create a pop up window with username and password.

private bool login()
{
// Create service object
SforceService sfdc = new SforceService();

// Invoke the login call and save results in LoginResult
LoginResult lr = new LoginResult();

try
{
lr = sfdc.login("salesforce@nexpath.ca", "nexpath@23");
}
catch (Exception ex)
{
string str = ex.Message;
}

if (!lr.passwordExpired)
{
// Reset the SOAP endpoint to the returned server URL
sfdc.Url = lr.serverUrl;
// Create a new session header object
// Add the session ID returned from the login
sfdc.SessionHeaderValue = new SessionHeader();
sfdc.SessionHeaderValue.sessionId = lr.sessionId;
GetUserInfoResult userInfo = lr.userInfo;
return true;
}
else
{
return false;
//Login operation failed
Console.WriteLine("You password is expired.");
}

the above code is to log in to salesforce.com credential.
i really appreciate your help.

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.