Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Populate values from GridView to ModalDialog box using Javascript....?

Populate values from GridView to ModalDialog box using Javascript....?

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptcssasp-netxml
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    codingrocks
    wrote on last edited by
    #1

    I am doing a web application in which i have XML file and data from it is bind to a gridview. I have a Link button in Gridview under column UserName On clicking name links, a ModalDialogbox opens which has some textboxes and buttons I want values from the grid view in the page to populate into ModalDialogbox using javascript..... the sample code i was using is OnClientClick of Linkbutton calls function function EditUserForm() { var winopen = showModalDialog("AddUser.aspx?",window, "dialogLeft:250px;dialogTop:300px;dialogHeight:400px;dialogWidth:600px;center:no;help:no;resizable:yes;scroll:yes;status:no" ); } Please help with some code sample.... Thanks in advance

    SAJAN A PILLAI ASP.NET,C#.NET Programmer BANGALORE "Winners don't do different things. They do things differently. ...

    N 1 Reply Last reply
    0
    • C codingrocks

      I am doing a web application in which i have XML file and data from it is bind to a gridview. I have a Link button in Gridview under column UserName On clicking name links, a ModalDialogbox opens which has some textboxes and buttons I want values from the grid view in the page to populate into ModalDialogbox using javascript..... the sample code i was using is OnClientClick of Linkbutton calls function function EditUserForm() { var winopen = showModalDialog("AddUser.aspx?",window, "dialogLeft:250px;dialogTop:300px;dialogHeight:400px;dialogWidth:600px;center:no;help:no;resizable:yes;scroll:yes;status:no" ); } Please help with some code sample.... Thanks in advance

      SAJAN A PILLAI ASP.NET,C#.NET Programmer BANGALORE "Winners don't do different things. They do things differently. ...

      N Offline
      N Offline
      Nishant Singh
      wrote on last edited by
      #2

      Accessing Controls of parent form in JavaScript of PopUp var winobj=window.opener; txt2=winobj.document.getElementById('Textbox2'); For Grid View Objects Row Data bound add onclick of LinkButton add following attributes LinkButton I1 = (LinkButton)(e.Row.FindControl("LinkButton")); I1.Attributes.Add("onClick", "OpenPopUp('" + I1.ClientID+ "');"); Now in JavaScript you will get the ClientId of link button clicked You can send it as a Query string function OpenPopUp(mes) { var mest=mes; alert(mes); window.open("WebTest.aspx?CntrlId="+mes,"WebPopUp",'width=200,height=200,location=yes'); } Now in PopUp page assign this Id in some Hiddenfield manipulate this value to retrieve id's of other grid controls eg : Suppose u got Id of LinkBtn as GridView1_ctl00_ImageX and in the same row u have a textbox with Id "txtname" so it's ClientId will be DataList1_ctl00_txtname u can access the textbox above as (A little string manipulation is required) var winobj=window.opener; txt2=winobj.document.getElementById('DataList1_ctl00_txtname');

      modified on Tuesday, November 25, 2008 9:22 AM

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups