Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIproblem in filling a datatable and showing it in a datagrid by calling a web method by its behaviorproblem in filling a datatable and showing it in a datagrid by calling a web method by its behavior
Previous
 
Next
New Post
7/12/2008 12:53 AM
 

Hello Mate!,      

                        First of all i have two webpages. one acts as a master page and other one acts as a popup page. when i click a button (say Add button) in the master page the pop up page should open. and when i click submit button in the pop up page after entering some values in the textboxes of the pop up page, a jscript function should take the values of the text boxes in the pop up page and should pass it to a webmethod which accepts these parameters.             

                      In the webmethod i am filling a datatable with the parameters that i had received from the jscript function and storing that datatable in a session variable.                      

                after these operation the jscript function should close the popup window and should refresh the parent window making a datagrid in the master page populated with that datatable from session .      

                         i am using the webservice behavior to call the webmethod from jscript .

                       every thing works fine but when i enter some values in the pop up page and click submit button those values weren't populated in the datagrid. instead when do this operation again and click submit button the values which i had entered in the first operation gets filled in the operation.

                Or only when i refresh the master page after performing the first operation the datagird gets filled with those values in the pop up page.

 

This is the Jscript function that passes the values in the popup page to a web method and this function will be invoked when we click  submit button in the pop up page:

I have used 'opener.submit' to aviod a message box saying 'the page cannot be refreshed with out resending the information'.

function CreateAndFillTable()

{

 

var

strtxtCust_cp_code = document.getElementById("Table1_txtCust_cp_code").value;

var

strtxtCust_cp_name = document.getElementById("Table1_txtCust_cp_name").value;

var

strtxtCust_cp_desig = document.getElementById("Table1_txtCust_cp_desig").value;

var

strtxtcust_cp_ph_no = document.getElementById("Table1_txtCust_cp_phone_no").value;

var

strtxtCust_cp_mobile_no = document.getElementById("Table1_txtCust_cp_mobile_no").value;

var

strtxtCust_cp_email_id = document.getElementById("Table1_txtCust_cp_email").value;var strtxtCust_cp_rmks = document.getElementById("Table1_txtCust_cp_rmks").value;

 

service.useService(
"http://192.168.10.29/logistics/Masters/GridTasks.asmx?WSDL","GridTasks"); iCallID1 = service.GridTasks.callService(SucceededCallback,"FillTable",strtxtCust_cp_code,strtxtCust_cp_name,strtxtCust_cp_desig,strtxtcust_cp_ph_no,strtxtCust_cp_mobile_no,strtxtCust_cp_email_id,strtxtCust_cp_rmks);

}

function SucceededCallback()

{

//debugger;

opener.document.forms["aspnetform"].submit();

window.close();

}

 This is the webmethod that fills a datatable using the parameters that had been received from the above jscript function:

<WebMethod(True)> _
Public Sub FillTable(ByVal strtxtCust_cp_code As String, ByVal strtxtCust_cp_name As String, ByVal strtxtCust_cp_desig As String, ByVal strtxtcust_cp_ph_no As String, ByVal strtxtCust_cp_mobile_no As String, ByVal strtxtCust_cp_email_id As String, ByVal strtxtCust_cp_rmks As String)

 

Dim Table6 As New DataTable

 

 

Delete.ColumnName =
Dim Delete As New DataColumn"Delete"

 

Dim Modify As New DataColumnModify.ColumnName = "Modify"

 

 

Dim Code As New DataColumn Code.ColumnName = "Code"

 

Dim Name As New DataColumn Name.ColumnName = "Name"

 

Dim Designation As New DataColumn Designation.ColumnName = "Designation"

 

Dim Phone As New DataColumn Phone.ColumnName = "Phone"

 

Dim Mobile As New DataColumn Mobile.ColumnName = "Mobile"

 

Dim Email As New DataColumn Email.ColumnName = "Email"

 

Dim Remarks As New DataColumnRemarks.ColumnName = "Remarks"

 

 

Table6.Columns.Add(Delete)

Table6.Columns.Add(Modify)

Table6.Columns.Add(Code)

Table6.Columns.Add(Name)

Table6.Columns.Add(Designation)

Table6.Columns.Add(Phone)

Table6.Columns.Add(Mobile)

Table6.Columns.Add(Email)

Table6.Columns.Add(Remarks)

 

If Session("CUST_Info") Is Nothing Then

Table6.Rows.Add(0)

Table6.Rows(0).Item(

"Delete") = "Delete.png"

Table6.Rows(0).Item(

"Modify") = "Modify.png"Table6.Rows(0).Item("Code") = strtxtCust_cp_code

Table6.Rows(0).Item(

Table6.Rows(0).Item(
"Name") = strtxtCust_cp_name"Designation") = strtxtCust_cp_desig

Table6.Rows(0).Item(

Table6.Rows(0).Item(
"Phone") = strtxtcust_cp_ph_no"Mobile") = strtxtCust_cp_mobile_no

Table6.Rows(0).Item(

Table6.Rows(0).Item(
"Email") = strtxtCust_cp_email_id"Remarks") = strtxtCust_cp_rmks

 

ElseTable6 = Session("CUST_Info")

 

Dim i As Integer

i = Table6.Rows.Count

Table6.Rows.Add(i)

Table6.Rows(i).Item(

"Delete") = "Delete.png"

Table6.Rows(i).Item(

"Modify") = "Modify.png"Table6.Rows(i).Item("CODE") = strtxtCust_cp_code

Table6.Rows(i).Item(

Table6.Rows(i).Item(
"Name") = strtxtCust_cp_name"Designation") = strtxtCust_cp_desig

Table6.Rows(i).Item(

Table6.Rows(i).Item(
"Phone") = strtxtcust_cp_ph_no"Mobile") = strtxtCust_cp_mobile_no

Table6.Rows(i).Item(

Table6.Rows(i).Item(
"Email") = strtxtCust_cp_email_id"Remarks") = strtxtCust_cp_rmks

 

End IfSession("CUST_Info") = Table6

 

End Sub


Thanks & luv U All, Myself
 
New Post
7/14/2008 9:23 AM
 

Your parent page and popup page are two different pages...  in fact you can treat them like two distinct browser instances.  It sounds like you are confused by the fact that the parent window doesn't get populated after the popup closes.  This is normal as that window does not have any refresh logic in it that I can see.   You either need to use js to cause the parent window to refresh itself, something like

window.location.href = window.location.href

or you need to use a more advanced grid control like I provided in last year's OpenForce conference

http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1664/Default.aspx


 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIproblem in filling a datatable and showing it in a datagrid by calling a web method by its behaviorproblem in filling a datatable and showing it in a datagrid by calling a web method by its behavior


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out