Jump to content

 

Photo

Free text on page load


  • Please log in to reply
11 replies to this topic

#1 Sriram

Sriram

    Member

  • Members
  • PipPip
  • 18 posts

Posted 02 March 2011 - 11:31 AM

I am having a treeview and a set of graphs in a asp.net page. When I am trying to populate graphs on page load it is showing some free text along with the graphs, every thing is fine if I am generating on graphs on click of a button or treeview node.

Can anyone please help me on this...

The free Text is like this:
(function() {var fn = function() {$get("ctl00_scm1_HiddenField").value = '';Sys.Application.remove_init(fn);};Sys.Application.add_init(fn);})(); WebForm_InitCallback();var ctl00_MainContent_TreeDashBoard_Data = new Object(); ctl00_MainContent_TreeDashBoard_Data.images = ctl00_MainContent_TreeDashBoard_ImageArray; ctl00_MainContent_TreeDashBoard_Data.collapseToolTip = "Collapse {0}"; ctl00_MainContent_TreeDashBoard_Data.expandToolTip = "Expand {0}"; ctl00_MainContent_TreeDashBoard_Data.expandState = theForm.elements['ctl00_MainContent_TreeDashBoard_ExpandState']; ctl00_MainContent_TreeDashBoard_Data.selectedNodeID = theForm.elements['ctl00_MainContent_TreeDashBoard_SelectedNode']; ctl00_MainContent_TreeDashBoard_Data.selectedClass = 'ctl00_MainContent_TreeDashBoard_4 '; ctl00_MainContent_TreeDashBoard_Data.selectedHyperLinkClass = ''; for (var i=0;i<6;i++) { var preLoad = new Image(); if (ctl00_MainContent_TreeDashBoard_ImageArray[i].length > 0) preLoad.src = ctl00_MainContent_TreeDashBoard_ImageArray[i]; } ctl00_MainContent_TreeDashBoard_Data.lastIndex = 21; ctl00_MainContent_TreeDashBoard_Data.populateLog = theForm.elements['ctl00_MainContent_TreeDashBoard_PopulateLog']; ctl00_MainContent_TreeDashBoard_Data.treeViewID = 'ctl00$MainContent$TreeDashBoard'; ctl00_MainContent_TreeDashBoard_Data.name = 'ctl00_MainContent_TreeDashBoard_Data'; Sys.WebForms.PageRequestManager.getInstance()._registerDisposeScript("ctl00_MainContent_up1", "ctl00_MainContent_TreeDashBoard_ImageArray.length = 0;\r\nctl00_MainContent_TreeDashBoard_Data = null;"); Sys.Application.initialize(); //]]>

Attached Files



#2 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,588 posts
  • Gender:Male
  • Location:Bangalore

Posted 03 March 2011 - 04:48 AM

Sriram,

Can you please share the code for page load so that we can find out the issue.

Regards,
Vivek
Team Visifire


#3 Sriram

Sriram

    Member

  • Members
  • PipPip
  • 18 posts

Posted 03 March 2011 - 05:50 AM

Hi Vivek,

I am having the code in somany files across the project and tha data is coming from the database. I am attaching a file containing the important lines which I am using to generate the graphs.

Thanks for anticipation.
Sriram
Attached File  Code.rtf   6.44K   4 downloads

I am having a treeview and a set of graphs in a asp.net page. When I am trying to populate graphs on page load it is showing some free text along with the graphs, every thing is fine if I am generating on graphs on click of a button or treeview node.

Can anyone please help me on this...

The free Text is like this:
(function() {var fn = function() {$get("ctl00_scm1_HiddenField").value = '';Sys.Application.remove_init(fn);};Sys.Application.add_init(fn);})(); WebForm_InitCallback();var ctl00_MainContent_TreeDashBoard_Data = new Object(); ctl00_MainContent_TreeDashBoard_Data.images = ctl00_MainContent_TreeDashBoard_ImageArray; ctl00_MainContent_TreeDashBoard_Data.collapseToolTip = "Collapse {0}"; ctl00_MainContent_TreeDashBoard_Data.expandToolTip = "Expand {0}"; ctl00_MainContent_TreeDashBoard_Data.expandState = theForm.elements['ctl00_MainContent_TreeDashBoard_ExpandState']; ctl00_MainContent_TreeDashBoard_Data.selectedNodeID = theForm.elements['ctl00_MainContent_TreeDashBoard_SelectedNode']; ctl00_MainContent_TreeDashBoard_Data.selectedClass = 'ctl00_MainContent_TreeDashBoard_4 '; ctl00_MainContent_TreeDashBoard_Data.selectedHyperLinkClass = ''; for (var i=0;i<6;i++) { var preLoad = new Image(); if (ctl00_MainContent_TreeDashBoard_ImageArray[i].length > 0) preLoad.src = ctl00_MainContent_TreeDashBoard_ImageArray[i]; } ctl00_MainContent_TreeDashBoard_Data.lastIndex = 21; ctl00_MainContent_TreeDashBoard_Data.populateLog = theForm.elements['ctl00_MainContent_TreeDashBoard_PopulateLog']; ctl00_MainContent_TreeDashBoard_Data.treeViewID = 'ctl00$MainContent$TreeDashBoard'; ctl00_MainContent_TreeDashBoard_Data.name = 'ctl00_MainContent_TreeDashBoard_Data'; Sys.WebForms.PageRequestManager.getInstance()._registerDisposeScript("ctl00_MainContent_up1", "ctl00_MainContent_TreeDashBoard_ImageArray.length = 0;\r\nctl00_MainContent_TreeDashBoard_Data = null;"); Sys.Application.initialize(); //]]>



#4 Eva

Eva

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • Gender:Female

Posted 03 March 2011 - 09:19 AM

Sriram,

There are some problems in the following code.

ScriptManager.RegisterStartupScript(TryCast(sender, Page), Me.[GetType](), "onload", [Where is start script tag here?] s & " </script><script language='JavaScript'> " & s2 & " </script><script language='JavaScript'> " & s3 & " </script><script language='JavaScript'> " & s4 & " </script><script language='JavaScript'> " & s5 & " </script><script language='JavaScript'> " & s6 & " </script>", True)

I didn't find start <script> tag. You have used so many <script> tags! Try the code below

ScriptManager.RegisterStartupScript(TryCast(sender, Page), Me.[GetType](), "onload", "<script language='JavaScript'> " & s & s2 & s3 & s4 & s5 & s6 & "</script>", True)
Regards,
Eva

#5 Sriram

Sriram

    Member

  • Members
  • PipPip
  • 18 posts

Posted 07 March 2011 - 04:50 AM

Vivek,

I have added the start script tag but the problem still remained

Thanks,
Sriram

Sriram,

There are some problems in the following code.

ScriptManager.RegisterStartupScript(TryCast(sender, Page), Me.[GetType](), "onload", [Where is start script tag here?] s & " </script><script language='JavaScript'> " & s2 & " </script><script language='JavaScript'> " & s3 & " </script><script language='JavaScript'> " & s4 & " </script><script language='JavaScript'> " & s5 & " </script><script language='JavaScript'> " & s6 & " </script>", True)

I didn't find start <script> tag. You have used so many <script> tags! Try the code below

ScriptManager.RegisterStartupScript(TryCast(sender, Page), Me.[GetType](), "onload", "<script language='JavaScript'> " & s & s2 & s3 & s4 & s5 & s6 & "</script>", True)



#6 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,588 posts
  • Gender:Male
  • Location:Bangalore

Posted 07 March 2011 - 02:17 PM

Sriram,

Are you still getting the same text?

Regards,
Vivek
Team Visifire


#7 Sriram

Sriram

    Member

  • Members
  • PipPip
  • 18 posts

Posted 09 March 2011 - 07:57 AM

Sriram,

Are you still getting the same text?



Hi Vivek,

I am still getting the text

Thanks,
Sriram

#8 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,588 posts
  • Gender:Male
  • Location:Bangalore

Posted 09 March 2011 - 09:08 AM

Sriram,

I would suggest you to refer the example present in our documentation here. This is the similar kind of example. Hope this will help you to find out the issue.

Regards,
Vivek
Team Visifire


#9 Sriram

Sriram

    Member

  • Members
  • PipPip
  • 18 posts

Posted 16 March 2011 - 07:35 AM

Hi Vivek,

I have checked the example you have provided. The Problem is reflecting only if I am populating the graph on page load but not on generation of any event. Can you please provide an example which is generating a graph on pageload in asp.net.

Thanks
Sriram,

I would suggest you to refer the example present in our documentation here. This is the similar kind of example. Hope this will help you to find out the issue.



#10 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,588 posts
  • Gender:Male
  • Location:Bangalore

Posted 16 March 2011 - 01:55 PM

Please refer to the example below:
http://www.visifire...._using_ajax.htm

Regards,
Vivek
Team Visifire


#11 Sriram

Sriram

    Member

  • Members
  • PipPip
  • 18 posts

Posted 11 April 2011 - 06:07 AM

Hi Vivek,


Where do we need to write the following code if we are required to generate the graph on page load.

Can you please provide a solution file for the above example.

String xaml = GetXAML();
string s = "vChart.setDataXml(\'" + xaml + "\');"
                 + "vChart.render(\"VisifireChart1\");";
ScriptManager scriptManager = ScriptManager.GetCurrent(Page);
ScriptManager.RegisterClientScriptBlock(sender as RadioButton, this.GetType(), "onClick", "<script language='JavaScript'> " + s + " </script>", false);

#12 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,588 posts
  • Gender:Male
  • Location:Bangalore

Posted 20 April 2011 - 05:53 AM

Sriram,

You have to write the same code as it is, in the Page_Load event handler. In the above example, it is written inside oncheckedchanged event of RadioButton. You can copy and paste the same .aspx and .cs code in your project and it will work.

Regards,
Vivek
Team Visifire





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users