Showing posts with label event. Show all posts
Showing posts with label event. Show all posts

Wednesday, March 28, 2012

accessing javascript from code behind

Hello,

Ok, heres my scenario:

On the Client Side - I have a javascript event that populates a variable with a new value from an embeded activex control.

On the Server Side - I have a dataview that hooked to a database.

Desired Result - When the javascript event fires I need to pass the value of the changed variable to the server via a callback or something and populate the dataview based on the value received.

I know how to callback to the server on client event but My question is how do I access or pass that javascript value to the server? (Better yet does anybody know how to access a com object embeded in the browser from C#?)

I thought this would be easy but I just can't figure it out.

Thanks, Justin.

If I can gather what your saying, all you need to do is add runat="server" and an ID to whatever control you want and you can access it serverside. What most people do is add it to a hidden input, set that in javascript, and then access it via its ID in c#.

<input type="hidden" runat="server" id="theValue" />

theValue.Value = "Hello";


Create a hidden field on the page. Then from the client side JavaScript populate the hidden field with the value from the ActiveX control. You can then refer the value of the hidden field in the .CS file.

Let me know if you need a code example.


Thanks for the replies.


Hi...

I am using a code as below but getng an error saying hdClientUTC undefined evnthough i declared tht can any one help me. I want to get the content of offset variable in my C# code.

HtmlInputHidden hdClientUTC;

ClientScript.RegisterStartupScript(this.GetType(),"MyScript","<Script for=" +"window" +" " +"event=" +"onload" +" " +"language=" +"jscript" +">" +" var now = new Date(); var offset = now.getTimezoneOffset(); alert(offset); hdClientUTC.Value = offset; document.Form1.submit(); " +"</Script>");

Accessing controls inside an updatepanel in onPreInit event

I have an update panel inside a user control that is initialized during the page's PreInit event. However, as soon as I put an updatepanel inside this user control I can no longer access the controls inside this updatepanel during the PreInit event. The controls are all just "null". Am I doing something wrong, or does the updatepanel somehow change my ability to access these controls?Thanks,Jon

Set a breakpoint in PreInit and step through the PageLifeCycle then you see in what Event the UpdatePanel get initialized.


I was just wondering why putting an updatepanel in would break my existing code? Shouldn't it get initialized at the same time as the other controls?
Please have a look at Wally'sPodcast about the clientside lifecycle. I think he's awnsering youre questions.

Saturday, March 24, 2012

A simple question: Do webservices work with the beta?

I can't seem to get of my webservice to work. All I get is object undefined. I have javascript that gets triggered on an onblur() event which calls a webservice where the code is in another file. Nothing I do will get it to work. I've tried all the solutions I've found and still errors.

Same goes for cascadingdropdowns. It's like my webservice is invisible. I read the sticky about putting the webservice call in the aspx file and I did that but it still can't be found.

I find that the documentation is limited and what I do find, it seems to be written for experts. So, I guess for now, I have no option but to dump the path I'm on since it appears to me the code isn't ready for beta. Too many issues. Not enough documentation and examples.

Very frustrated!

Hi jax67, can we see the webservice class and the javascript function that calls it? Also the error message that you are getting. Maybe I can help. I used cascadingdropdowns a lot too, it was very frustated at first, but then I figured it out. So, everything is all good now.

Thanks AW - I am so frustrated :( The first file is in a folder called Maint (off of the root) and the webservice asmx file is in the root. The code for the webservice is in app_code.

Here is the code that has the javascript call. The onblur is what calls the javascript and that part works. It's the actual call to the service that fails. I put an alert before the call and the alert is displayed. A javascript error occurs after I dismiss the alert. I do not have the alert code in the following code files.

Thank you for any help you can provide. I really do appreciate it...

Dave

<%@. Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeFile="Amendment.aspx.cs" Inherits="Maint_Amendment" Title="Add A New Contract Amendment"
EnableEventValidation="false" %>
<%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<ajax:ScriptManager ID="sm" runat="server" EnablePartialRendering="True">
<Services>
<ajax:ServiceReference Path="../ContractService.asmx"/>
</Services>
</ajax:ScriptManager>
<script type="text/javascript" language="javascript">
function AddDates_click()
{
// Get the values necessary to pass to the webservice
var startDate = $get('<%= txtStartDate.ClientID %>').value;

var periodInYears = $get('<%= txtPeriodYears.ClientID %>').value;
if (periodInYears == "") periodInYears = "0";

var periodInMonths = $get('<%= txtPeriodMonths.ClientID %>').value;
if (periodInMonths == "") periodInMonths = "0";

if (startDate != "")
{
// Show the progress and resize the textbox
document.getElementById('calculating').style.display = '';
$get('<%= txtExpirationDate.ClientID %>').style.width = '90%';
// Make the call to the webservice
alert("Before Call...");
var x = ContractService.CalculateExpirationDate(startDate, periodInYears, periodInMonths, OnComplete, OnTimeout);
}

return false;
}
function OnComplete(result)
{
$get('<%= txtExpirationDate.ClientID %>').value = result;
document.getElementById('calculating').style.display = 'none';
$get('<%= txtExpirationDate.ClientID %>').style.width = '98%';
}
function OnTimeout(result)
{
document.getElementById('calculating').style.display = 'none';
$get('<%= txtExpirationDate.ClientID %>').style.width = '98%';
}
</script>
<ajax:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<img src="http://pics.10026.com/?src=../images/spinner.gif" />
</ProgressTemplate>
</ajax:UpdateProgress>
<ajax:UpdatePanel ID="upAmendment" runat="server">
<ContentTemplate>
<table align="center" border="1" bordercolor="#000000" cellpadding="4" style='width: 50%;
border-collapse: collapse">
<tr>
<td class="label" style='width: 30%'>
<asp:Label ID="Label2" runat="server" SkinID="bold" Text="Amendment Num"></asp:Label></td>
<td class="alt">
<asp:TextBox ID="txtAmendmentNumber" runat="server" MaxLength="10" ReadOnly="True"></asp:TextBox><br />
<asp:TextBox ID="txtContract" runat="server" ReadOnly="True" Visible="False"></asp:TextBox></td>
</tr>
<tr>
<td class="label" style='width: 30%'>
<asp:Label ID="lblStartDate" runat="server" SkinID="bold" Text="Start Date"></asp:Label></td>
<td class="alt">
<asp:TextBox ID="txtStartDate" runat="server" MaxLength="15" onblur="return AddDates_click()"
AutoCompleteType="Disabled"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtStartDate"
Display="Dynamic" ErrorMessage="This field is required"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regStartDate" runat="server" ControlToValidate="txtStartDate"
Display="Dynamic" ErrorMessage="Invalid Date Format"></asp:RegularExpressionValidator></td>
</tr>
<tr>
<td class="label" style='width: 30%'>
<asp:Label ID="Label3" runat="server" SkinID="bold" Text="Period (Years)"></asp:Label></td>
<td class="alt">
<asp:TextBox ID="txtPeriodYears" runat="server" MaxLength="3" onblur="return AddDates_click()"
AutoCompleteType="Disabled"></asp:TextBox>
<asp:RangeValidator ID="rngYears" runat="server" ControlToValidate="txtPeriodYears"
Display="Dynamic" ErrorMessage="Invalid Value" MaximumValue="100" MinimumValue="1"
Type="Integer" SetFocusOnError="True"></asp:RangeValidator>
</td>
</tr>
<tr>
<td class="label" style='width: 30%'>
<asp:Label ID="Label4" runat="server" SkinID="bold" Text="Period (Months)"></asp:Label></td>
<td class="alt">
<asp:TextBox ID="txtPeriodMonths" runat="server" MaxLength="2" onblur="return AddDates_click()"
AutoCompleteType="Disabled"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txtPeriodMonths"
Display="Dynamic" ErrorMessage="Invalid Value" MaximumValue="11" MinimumValue="0"
SetFocusOnError="True" Type="Integer"></asp:RangeValidator></td>
</tr>
<tr>
<td class="label" style='width: 30%'>
<asp:Label ID="Label5" runat="server" SkinID="bold" Text="Expiration Date"></asp:Label></td>
<td class="alt">
<asp:TextBox ID="txtExpirationDate" TabIndex="-1" runat="server" MaxLength="15"></asp:TextBox>
<span id="calculating" style='display: none;'>
<img src="http://pics.10026.com/?src=../images/spinner.gif" /></span>
</td>
</tr>
<tr>
<td class="label" style='width: 30%'>
<asp:Label ID="Label11" runat="server" SkinID="bold" Text="Class"></asp:Label></td>
<td class="alt">
<asp:DropDownList ID="ddlClass" runat="server">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="reqClass" runat="server" ControlToValidate="ddlClass"
Display="Dynamic" ErrorMessage="This field is required"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td class="label" style='width: 30%'>
<asp:Label ID="Label12" runat="server" SkinID="bold" Text="Type Of"></asp:Label></td>
<td class="alt">
<asp:DropDownList ID="ddlType" runat="server">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="reqType" runat="server" ControlToValidate="ddlType"
Display="Dynamic" ErrorMessage="This field is required"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td class="label" style='width: 30%'>
<asp:Label ID="Label6" runat="server" SkinID="bold" Text="Consideration"></asp:Label></td>
<td class="alt">
<asp:TextBox ID="txtConsideration" runat="server" MaxLength="10" AutoCompleteType="Disabled"></asp:TextBox>
<asp:RangeValidator ID="rngConsideration" runat="server" ControlToValidate="txtConsideration"
Display="Dynamic" ErrorMessage="Invalid Value" MaximumValue="999999999" MinimumValue="0"
SetFocusOnError="True" Type="Double"></asp:RangeValidator>
</td>
</tr>
<tr>
<td class="label" style='width: 30%'>
<asp:Label ID="Label7" runat="server" SkinID="bold" Text="Percent of Credit"></asp:Label></td>
<td class="alt">
<asp:TextBox ID="txtPercentCredit" runat="server" MaxLength="30" AutoCompleteType="Disabled"></asp:TextBox>
<asp:RangeValidator ID="rngPercentCredit" runat="server" ControlToValidate="txtPercentCredit"
Display="Dynamic" ErrorMessage="Invalid Value" MaximumValue="100" MinimumValue="0"
SetFocusOnError="True" Type="Double"></asp:RangeValidator></td>
</tr>
<tr>
<td class="label" style='width: 30%'>
<asp:Label ID="Label8" runat="server" SkinID="bold" Text="Credit Type"></asp:Label></td>
<td class="alt">
<asp:DropDownList ID="ddlCreditType" runat="server" DataTextField="LOV_ITEM" DataValueField="LOV_VALUE">
</asp:DropDownList></td>
</tr>
<tr>
<td class="label" style='width: 30%'>
<asp:Label ID="Label9" runat="server" SkinID="bold" Text="Carry Forward (Years)"></asp:Label></td>
<td class="alt">
<asp:TextBox ID="txtCarryForward" runat="server" MaxLength="2" AutoCompleteType="Disabled"></asp:TextBox>
<asp:RangeValidator ID="rngCarryForward" runat="server" ControlToValidate="txtCarryForward"
Display="Dynamic" ErrorMessage="Invalid Value" MaximumValue="100" MinimumValue="0"
SetFocusOnError="True" Type="Integer"></asp:RangeValidator></td>
</tr>
<tr>
<td class="label" style='width: 30%'>
<asp:Label ID="Label10" runat="server" SkinID="bold" Text="Assignable ?"></asp:Label></td>
<td class="alt">
<asp:RadioButtonList ID="optAssignable" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Value="Y">Yes</asp:ListItem>
<asp:ListItem Value="N">No</asp:ListItem>
</asp:RadioButtonList></td>
</tr>
<tr>
<td class="label" style='width: 30%'>
<asp:Label ID="lblEffectivityDate" runat="server" SkinID="bold" Text="Effectivity Date"></asp:Label></td>
<td class="alt">
<asp:TextBox ID="txtEffectivityDate" runat="server" AutoCompleteType="Disabled" MaxLength="15"
onblur="return AddDates_click()"></asp:TextBox>
<asp:RegularExpressionValidator ID="regEffectivityDate" runat="server" ControlToValidate="txtEffectivityDate"
Display="Dynamic" ErrorMessage="Invalid Date Format"></asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="reqEffectivityDate" runat="server" ControlToValidate="txtEffectivityDate"
Display="Dynamic" ErrorMessage="This field is required"></asp:RequiredFieldValidator></td>
</tr>
</table>
<ajaxToolkit:CascadingDropDown ID="cddClass" runat="server" Category="Class" PromptText="Select a Class"
ServicePath="../ContractService.asmx" ServiceMethod="GetClasses" TargetControlID="ddlClass" Enabled="true" />
<ajaxToolkit:CascadingDropDown ID="cddType" runat="server" Category="Type" PromptText="Select a Type"
ServicePath="../ContractService.asmx" ServiceMethod="GetTypes" TargetControlID="ddlType" ParentControlID="ddlClass" Enabled="true" />
<ajaxToolkit:TextBoxWatermarkExtender ID="wmPeriodYears" runat="server" TargetControlID="txtPeriodYears" WatermarkCssClass="WaterMark" WatermarkText="Terms in years" />
<ajaxToolkit:TextBoxWatermarkExtender ID="wmPeriodMonths" runat="server" TargetControlID="txtPeriodMonths" WatermarkCssClass="WaterMark" WatermarkText="Terms in months" />
<ajaxToolkit:TextBoxWatermarkExtender ID="wmStartDate" runat="server" TargetControlID="txtStartDate" WatermarkCssClass="WaterMark" WatermarkText="Contract Start Date" />
<ajaxToolkit:TextBoxWatermarkExtender ID="wmConsideration" runat="server" TargetControlID="txtConsideration" WatermarkCssClass="WaterMark" WatermarkText="Amount paid or units mined in consideration" />
<ajaxToolkit:TextBoxWatermarkExtender ID="wmPercentCredit" runat="server" TargetControlID="txtPercentCredit" WatermarkCssClass="WaterMark" WatermarkText="% of credit received from payment" />
<ajaxToolkit:TextBoxWatermarkExtender ID="wmCarryForward" runat="server" TargetControlID="txtCarryForward" WatermarkText="Period in years credits may be carried forward" WatermarkCssClass="WaterMark" />
<ajaxToolkit:TextBoxWatermarkExtender ID="wmEffectivityDate" runat="server" TargetControlID="txtEffectivityDate" WatermarkCssClass="WaterMark" WatermarkText="When does this amendment take affect" />
</ContentTemplate>
</ajax:UpdatePanel>
<asp:Panel runat="server" ID="pnlReasonForEdit" SkinID="reasonforedit">
<br />
<table align="center" border="1" bordercolor="#000000" cellpadding="4" style='width: 50%;
border-collapse: collapse">
<tr>
<td class="label" style='width: 30%'>
<asp:Label ID="Label1" runat="server" SkinID="bold" Text="Reason for Edit"></asp:Label></td>
<td class="alt">
<asp:TextBox ID="txtReasonForEdit2" runat="server" MaxLength="2000" TextMode="MultiLine"
Rows="2"></asp:TextBox>
<asp:RequiredFieldValidator ID="reqReasonForEdit" runat="server" ControlToValidate="txtReasonForEdit2"
Display="Dynamic" ErrorMessage="A reason must be entered" SetFocusOnError="True"></asp:RequiredFieldValidator></td>
</tr>
</table>
</asp:Panel>
<p align="center">
<asp:Button ID="cmdSave" runat="server" OnClick="cmdSave_Click" Text="Save" />
<asp:Button ID="cmdCancel" runat="server" CausesValidation="False" OnClick="cmdCancel_Click"
Text="Cancel" />
</p
<script type="text/javascript">
var styleToSelect;
function onOk() {
//$get('Paragraph1').className = styleToSelect;
}
</script
<asp:Panel ID="Panel1" runat="server" Style='display: none' Width='65%' SkinID='ReasonHeader'>
Please provide a reason for the edit
<asp:Panel ID="pnlBody" runat="server" SkinID="ReasonBody" Style='margin: 5px;'>
<br />
Enter the reason for editing this Amendment:
<asp:TextBox EnableTheming="false" runat="server" ID="txtReasonForEdit" TextMode="multiLine"
Width="96%" Rows="5"></asp:TextBox>
<br />
<br />
<center>
<asp:Button ID="OkButton" runat="server" Text="OK"></asp:Button>
<asp:Button ID="CancelButton" runat="server" Text="Cancel"></asp:Button>
</center>
<br />
</asp:Panel>
</asp:Panel>
</asp:Content>

Here is the Webservice file:

using System;
using System.Data;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using AjaxControlToolkit;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Web.Script.Services;

/// <summary>
/// Summary description for ContractService
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[Microsoft.Web.Script.Services.ScriptService()]
public class ContractService : System.Web.Services.WebService {

public ContractService () {

//Uncomment the following line if using designed components
//InitializeComponent();
}

[WebMethod]
public string GetNextContractSequence(string contract)
{
// ---------------------------
// Author: dzangger
// Company: Huber
// Date: 8/4/2006
// Time: 12:06
// Procedure Name: GetNextContractSequence
// Purpose: Get the next available sequence number for contract
// Parameters:
// - contract (string)() :
// ---------------------------
return contract.ToUpper() + CMSDB.GetNextContractSequence(contract.ToUpper());
}

[WebMethod]
public string DoesContractExist(string contract)
{
bool b = CMSDB.DoesContractExist(contract);

if (b)
return "~" + contract.ToUpper();
else
return contract.ToUpper();
}

[WebMethod]
public string GetIndexValue(string index, string beginDate, string endDate)
{
try
{
DateTime d = Convert.ToDateTime(beginDate);
d = Convert.ToDateTime(endDate);
}
catch (Exception)
{
return "";
}

return CMSDB.GetIndexValueFromDateRange(index, beginDate, endDate);
}

[WebMethod]
public string CalculateExpirationDate(string startDate, string years, string months)
{
// ---------------------------
// Author: dzangger
// Company: Huber
// Date: 8/3/2006
// Time: 13:21
// Procedure Name: CalculateExpirationDate
// Purpose: Adds a number of years and months to a given date
// Parameters:
// - startDate (string)() :
// - years (string)() :
// - months (string)() :
// ---------------------------
try
{
int iYears = 0, iMonths = 0;

try
{
iYears = Convert.ToInt16(years);
}
catch (Exception)
{
iYears = 0;
}

try
{
iMonths = Convert.ToInt16(months);
}
catch (Exception)
{
iMonths = 0;
}

DateTime date = Convert.ToDateTime(startDate);

if (iYears > 0)
date = date.AddYears(iYears);

if (iMonths > 0)
date = date.AddMonths(iMonths);

return date.ToShortDateString();
}
catch (Exception)
{
return "";
}
}

[WebMethod]
[Microsoft.Web.Script.Services.ScriptMethod()]
public AjaxControlToolkit.CascadingDropDownNameValue[] GetIndexTypes(string knownCategoryValues, string category)
{
// ---------------------------
// Author: david.zangger
// Company: Huber
// Date: 10/13/2006
// Time: 07:27
// Procedure Name: GetIndexTypes
// Purpose: Gets the indexes and their types
// Parameters:
// - knownCategoryValues (string)() :
// - category (string)() :
// ---------------------------
List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();

IDataReader reader = CMSDB.GetIndexesAndIndexTypes();

while (reader.Read())
{
string classId = reader[0].ToString();
string index = reader[1].ToString();
values.Add(new CascadingDropDownNameValue(classId, index));
}

reader.Close();

return values.ToArray();
}

[WebMethod]
[Microsoft.Web.Script.Services.ScriptMethod()]
public AjaxControlToolkit.CascadingDropDownNameValue[] GetIndexSeries(string knownCategoryValues, string category)
{
List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();

StringDictionary sd = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);

if (sd.ContainsKey("Index"))
{
IDataReader reader = CMSDB.GetSeriesIds(sd["Index"].ToString());

while (reader.Read())
{
string series = reader[0].ToString();
values.Add(new CascadingDropDownNameValue(series, series));
}

reader.Close();

return values.ToArray();
}
else
return null;
}

[WebMethod]
[Microsoft.Web.Script.Services.ScriptMethod()]
public AjaxControlToolkit.CascadingDropDownNameValue[] GetClasses(string knownCategoryValues, string category)
{
List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();

IDataReader reader = CMSDB.GetContractClasses();

while (reader.Read())
{
string classId = reader[0].ToString();
values.Add(new CascadingDropDownNameValue(classId, classId));
}

reader.Close();

return values.ToArray();
}

[WebMethod]
[Microsoft.Web.Script.Services.ScriptMethod()]
public AjaxControlToolkit.CascadingDropDownNameValue[] GetTypes(string knownCategoryValues, string category)
{
List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();

StringDictionary sd = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);

if (sd.ContainsKey("Class"))
{
IDataReader reader = CMSDB.GetContractTypes(sd["Class"].ToString());

while (reader.Read())
{
string classId = reader[1].ToString();
string desc = reader[0].ToString();
values.Add(new CascadingDropDownNameValue(desc, classId));
}

reader.Close();

return values.ToArray();
}
else
return null;
}
}

I seem to have it working. I created a new website (using the CTP version) and then used the web.config from that project. I migrated my appsettings and an Oracle assembly and then moved my webservice in the folder where the files calling it resides. For now, I'm going to leave it as it is.

Thanks AW for your assistance!

dave

Wednesday, March 21, 2012

a full postback within partialpostback and server event handler ?

I face several problems about using Atlas. Here is the problem :-

I have several anchors inside a big updatepanel. With these anchors, some of them have to raise a full postback, since i can't use a server.transfer when running in particalpostback call. I know i can create a dummy element outsite the updatepanel, and let those anchor (which need a full postback) call a _dopostback with that dummy element to raise a full postback. The problem is ... because there is a server event handler associated with each anchor, and If my understanding is right, by calling _dopostback manually, the server event handler will never get executed. I know i can set up some __EVENTARGUMENT and do whatever i want .. but is there any smarther and better solution ?

Why do you need the anchors inside the UpdatePanel? Can you have them outside (and therefore generate a regular postback)?

A form tag with runat=server must exist on the Page to use SetFocus() or the Focus propert

Hi there,

I have a Multiview control with Views. Right now I'm trying to set focus to a textbox using the Activate event of one of the Views, like this:

protected void vieSearchShipment_Activate(object sender, EventArgs e)
{
this.Setfocus(tbxShipment);
}

This is my Setfocus method:

protected void Setfocus(TextBox textBox)
{
(this.Master.FindControl("ScriptManager1") as Microsoft.Web.UI.ScriptManager).SetFocus(textBox);
}

But when I call the Setfocus() method from the View's Activate event, I get this exception:

A form tag with runat=server must exist on the Page to use SetFocus() or the Focus property.

The textBox is inside the View and is visible, of course. So what am I missing?

Thanks in advance,

-Benton

Check your <form ... > to see if you miss the runat=server or not.

WS


hi

i got error when i use focus property like this

error:

Invalid operation Exception Unhandled by user code,

A form tag with runat=server must exist on the Page to use SetFocus() or the Focus property.


my code:

protected void Page_Load(object sender, EventArgs e)
{
this.lgnUsers.Focus();
}

please help me



See the answer to your other post inthis thread.

A clientside event for UpdatePanel updated

Hi,

I would like to fire some javascript when a updatepanel is updated. Is this possibly?

Maybe an event or something on the updatepanel control...
Or a parameter which say runjavascripts like prototype has?

Regards,
JacobHi,

I've not tested it, but you could try to usethis control coded by SimoneB.