Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Ads  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  problem in filling a datatable and showing it in a datagrid by calling a web method by its behavior
Previous Previous
 
Next Next
New Post 7/11/2008 10:53 PM
User is offline Sidewinder2
7 posts
10th Ranked


problem in filling a datatable and showing it in a datagrid by calling a web method by its behavior 

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 7:23 AM
User is offline Jon Henning
1622 posts
www.codeendeavors.com
5th Ranked










Re: problem in filling a datatable and showing it in a datagrid by calling a web method by its behavior 

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 Previous
 
Next Next
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  problem in filling a datatable and showing it in a datagrid by calling a web method by its behavior
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Faculty of Graduate and Postdoctoral Studies
At the graduate level, the University of Ottawa offers more than 180 graduate certificates, master's degrees and PhDs, as well as interdisciplinary programs such as Women's Studies and Canadian Studies. Many postdoctoral opportunities are available in both the sciences and the humanities. For further information, please consult the site of the Faculty of Graduate and Postdoctoral Studies.
www.grad.uottawa.ca
Vekkin Solutions
Vekkin Solutions provides complete website solutions and custom module development to churches and small businesses.
www.vekkin.com
Powered by Adcuent®.Com
Adcuent® Consulting & Technology offers custom development web applications and hosting projects under the brand of Powered by Adcuent®.Com
www.adcuent.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP