473,507 Members | 2,430 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Call javascript form C# problem

111 New Member
Hi,

When I set EnablePartialRendering = false it works.

But I want EnablePartialRendering = true.

How to over come this.

Page.ClientScript.RegisterClientScriptBlock(Page.G etType(), "Move", "scrollToXY(10,10);", true);

Thanks in advance
Apr 16 '08 #1
4 3463
Frinavale
9,735 Recognized Expert Moderator Expert
Hi,

When I set EnablePartialRendering = false it works.

But I want EnablePartialRendering = true.

How to over come this.

Page.ClientScript.RegisterClientScriptBlock(Page.G etType(), "Move", "scrollToXY(10,10);", true);

Thanks in advance

What is the error you're getting?
Are you having problems registering your script in the page?
Consider using ScriptManager.RegisterClientScriptBlock instead.....

Could you please provide more information about your problem.

Thanks
-Frinny
Apr 16 '08 #2
baburk
111 New Member
What is the error you're getting?
Are you having problems registering your script in the page?
Consider using ScriptManager.RegisterClientScriptBlock instead.....

Could you please provide more information about your problem.

Thanks
-Frinny
No I didn't get any error on registering thescript in the page.

When I set PartialPageRendering = false it works fine.

But when i set it to PartialPageRendering = true it did't call the script and didn't throw any error.

Through breakpoint i chencked it called correctly.

I heard that when i set PartialPageRendering = false it renders only partial page.
So the script didn't load in the page. So the script can't be called.

Thanks
Apr 17 '08 #3
Frinavale
9,735 Recognized Expert Moderator Expert
No I didn't get any error on registering thescript in the page.

When I set PartialPageRendering = false it works fine.

But when i set it to PartialPageRendering = true it did't call the script and didn't throw any error.

Through breakpoint i chencked it called correctly.

I heard that when i set PartialPageRendering = false it renders only partial page.
So the script didn't load in the page. So the script can't be called.

Thanks
As I stated before, have you looked into using ScriptManager.RegisterClientScriptBlock instead of the Page.RegisterClientScriptBlock?

JavaScript doesn't work after a partial page update has occurred. In order to get around this the ScriptManager and ScriptManagerProxy classes were created. These allow you to re-register your JavaScript when the partial page update occurs so that it can still be accessed by the page.

-Frinny
Apr 17 '08 #4
baburk
111 New Member
Hi Frinavale,

I have put like this in C#

ScriptManager.RegisterClientScriptBlock(this, Page.GetType(), "Scroll", "ScrollToPosition();", true);

and the Script is

<script language = "javascript" type = "text/javascript">
function ScrollToPosition()
{
window.scrollTo(10,10);
}

</script>

The firefox grives an error message as ScrollToPosition is not defined but is scrolls.

In IE it gives an errormessage that Microsoft JScript runtime error: Object expected and it points to the script function ScrollToPosition

When I called the function from onClientClick it works fine on both the browsers.

Will you tell me what the wrong in thisScriptManager.RegisterClientScriptBlock(this, Page.GetType(), "Scroll", "ScrollToPosition();", true);

and also I tried like this ScriptManager.RegisterClientScriptBlock(this, Page.GetType(), "Scroll", "ScrollToPosition();", true);

Thanks
May 13 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2655
by: Sue | last post by:
After finishing up my first quarter JavaScript on 12/12/03, I decided to improve character checking on my project. In my project I only had to do very basic validation. Therefore, I only had one...
3
4016
by: JoeK | last post by:
Hey all, I am automating a web page from Visual Foxpro. I can control all the textboxes, radio buttons, and command buttons using syntax such as: ...
39
6477
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
4
4272
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage...
7
10967
by: C.Joseph Drayton | last post by:
I have a problem that I am hoping someone can help me with. First let me describe the problem. I have an HTML form that in one field has an onBlur call to a JavaScript function. When you exit the...
5
2575
by: settyv | last post by:
Hi, Below is the Javascript function that am trying to call from asp:Button control. <script language="javascript"> function ValidateDate(fromDate,toDate) { var fromDate=new Date();
11
11507
by: yangsuli | last post by:
i want to creat a link when somebody click the link the php script calls a function,then display itself :) i have tried <a href=<? funtion(); echo=$_server ?>text</a> but it will call the...
2
1888
by: Fabio Mastria | last post by:
My application has to call a webpage with some hidden field, fill their values with some parameters and then call the submit to the form which has the action property set to a page of another web...
7
1789
by: shahidrasul | last post by:
i have two problem 1. how to call a javascript function from form page and also how to call c# function from javascript because when user click on button i want to validate field of form and if...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7111
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7031
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7485
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1542
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.