|
|
Is is somehow possible to add a script using UpdatePanel?
My problem is that I have a DataGrid containg 2 couloms with 1 TextBox in each.
On the first TextBox there is an OnTextChangeEvent with an AutoPostBack="true",
and in this function I add scripts to set focus, and select the text on the next
TextBox as in:
private void OnSubscriptionFromValueChanged(object sender, System.EventArgs e)<br />
{<br />
TextBox tb = (TextBox)sender;<br />
DataGridItem dgi = (DataGridItem)tb.Parent.Parent;<br />
TextBox tbToFocus = (TextBox)dgi.FindControl("tbToValue");<br />
Page.ClientScript.RegisterStartupScript(GetType(), "focus", "<script>document.getElementById('" + tbToFocus.UniqueID + "').focus();</script>");<br />
Page.ClientScript.RegisterStartupScript(GetType(), "select", <script>document.getElementById('" + tbToFocus.UniqueID + "').select();</script>");<br />
..<br />
...<br />
.... <br />
}
This works fine.
But then I added an UpdatePanel around the DataGrid, as in
<br />
asp:UpdatePanel ID="upSubscription" runat="server"> <br />
<ContentTemplate> <br />
<asp:datagrid id="dgSubscription" runat="server" CssClass="grid" AllowPaging="False" CellPadding="0"<br />
GridLines="Vertical" AutoGenerateColumns="False" ShowFooter="true" OnItemCreated="dgSubscription_ItemCreated"><br />
asp:TemplateColumn HeaderText="From value" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="150px"><br />
ItemTemplate><br />
asp:TextBox id="tbFromValue" runat="server" AutoPostBack="true" CssClass="tbStyle0" Text='<%#DataBinder.Eval(Container.DataItem, "decFromValue").ToString()%>'> <br />
</asp:TextBox><br />
/ItemTemplate><br />
/asp:TemplateColumn><br />
<asp:TemplateColumn HeaderText="To value" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="150px"><br />
ItemTemplate><br />
asp:TextBox id="tbToValue" runat="server" AutoPostBack="true" CssClass="tbStyle0" Text='<%#DataBinder.Eval(Container.DataItem, "decToValue").ToString()%>'> <br />
</asp:TextBox> <br />
</ItemTemplate><br />
<br />
/asp:TemplateColumn><br />
asp:datagrid><br />
/ContentTemplate><br />
/asp:UpdatePanel> <br />
Now the focus and the select is lost, since the page only updated the DataGrid, and the
Page.ClientScript.RegisterStartupScript(GetType(), "focus", "&lt;script&gt;document.getElementById('" + tbToFocus.UniqueID + "').focus();&lt;/script&gt;");<br />
Page.ClientScript.RegisterStartupScript(GetType(), "select", "&lt;script&gt;document.getElementById('" + tbToFocus.UniqueID + "').select();&lt;/script&gt;");<br /> wasn't reggisterd at the Page.
Does anyone know a way around this?
Like creating a ScriptManager inside a UpdatePanel (thus that wan't work, as the ScriptManger has to be before a
control that uses scrips). I'm usint .Net 2.0 in Visual Studio 2005 enviroment.
Thanks
Thomas
|
|
|
|
|
I am trying to integrate paypal in my website , i have read the manuals still clueless how actually paypal transaction is done ,i made the business a/c and personal a/c in sandbox testing enviroment,but how i can transfer money from buyer to seller a/c. vat happens after checkout is made by buyer
,there is an api called dodirectpayment which sends information to paypal about buyer like his credit card number etc to paypal but how paypal credits it to my a/c.
any code would help me alot.
plz help me
|
|
|
|
|
chanu007 wrote: any code would help me alot.
We cannot do your work.
Get it
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
don't reply if u do not know yourself. Understand
|
|
|
|
|
Why don't you bug off if you can't behave yourself around here?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hi,
can anybody tell me how to save untouched data in a EditMode of a DeatilsView control. I mean, if I don't put the cursor in the field, even if there is a default data, after I press Update button it doesn't take those default values.
|
|
|
|
|
hell friends
iam the fresher for .net. i have a small doubt. i have 2 button contrls in one web page. when ever i click one button its redirect to one web page and alse i will send some value with that. and second button also same thing but in different web page.
(in short form how can i send some string with response object)
than you.
|
|
|
|
|
You could have a look at passing simple values in the querystring. Have a look at Request.Querystring.
|
|
|
|
|
Response.Redirect("Default1.aspx?strId=" & strValue)
|
|
|
|
|
Hi
U cfan do it with Query String Like Below
This is the Query String That is Passed From Page 1 To Page 2.
PayDetail1.HRef ="~/credit.aspx?typeid=" +Val.ToString();
And
This We Get In Page 2. Like this
if(Request.QueryString.Count>0)
{
if(Request.QueryString["typeid"].ToString()!=null)
{
typeid = Request.QueryString["typeid"];
}
}
Hope This Helps You...
If any problem then ask....
Just Do IT™ [Information Technology]™ :->
|
|
|
|
|
Hello Friends,
I want to send the ImageUrl fetching from the database to the Javascript function
<img onmouseover="javascript:doTooltip(event,0,'<%# DataBinder.Eval(Container.DataItem,"Image") %>')" onmouseout="hideTip()" id="myImage1" name="myImage1" src='<%# DataBinder.Eval(Container.DataItem,"Image") %>' Runat="server" Height="125" Width="125" />
But this piece of code throwing an Parser Error given below
The server tag is not well formed.
But if i give the path of a particular image then it works great....as given below
<img onmouseover="javascript:doTooltip(event,0,'Images/img1.jpg')" onmouseout="hideTip()" id="myImage1" name="myImage1" src='<%# DataBinder.Eval(Container.DataItem,"Image") %>' Runat="server" Height="125" Width="125" />
|
|
|
|
|
Is that image tag in Databound control (e.g. Gridview or Repeater or etc)?
|
|
|
|
|
Yes this image tag is DataBound control(DataList)
|
|
|
|
|
Hi all
I was trying to generate a PDF document from an html file. Below is what i have tried...
private bool GeneratePDF(string sOutputHTMLFile, string sOutPutFile)
{
try
{
Doc objDoc = new Doc();
objDoc.SetInfo(0, "License", "322-xxx-815-xxx-4945-xxx");
StreamReader sr = new StreamReader(sOutputHTMLFile, Encoding.Default); string input = sr.ReadToEnd();
objDoc.Rect.Inset(50, 50);
objDoc.Page = objDoc.AddPage();
int theID;
theID = objDoc.AddImageHtml(input, true, 1000, false);
while (true)
{
objDoc.FrameRect();
if (!objDoc.Chainable(theID))
break;
objDoc.Page = objDoc.AddPage();
theID = objDoc.AddImageToChain(theID);
}
for (int i = 1; i <= objDoc.PageCount; i++)
{
objDoc.PageNumber = i;
objDoc.Flatten();
}
objDoc.Save(sOutPutFile);
objDoc.Clear();
objDoc.Dispose();
return true;
}
catch (Exception ex)
{
return false;
}
}
These are the input parameters i have used...
http://localhost/webportal/PDF/Report3.html
C:\Inetpub\wwwroot\webportal\PDF\Report3.pdf
But when i execute this function i got an error like this "URI formats are not supported"
This line causes the error--> StreamReader sr = new StreamReader(sOutputHTMLFile, Encoding.Default);
Could you please tell how to solve this issue...............
Thanks in advance......
Regards
Sebastian
|
|
|
|
|
Please let me know , what was wrong with my posting.
I would like to know WHO marked it as ABUSE and WHY?
|
|
|
|
|
hi,
can anyone provide me the method for searching of specific word on the webpage.
Thanks in advance.
|
|
|
|
|
|
|
hahahahahaha ohh boy that is a good one!
probably the best thing I've heard all day!
wow u made my day man!
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
|
Mind Bloooowing
Just Do IT™ [Information Technology]™ :->
|
|
|
|
|
|
(?#WebOrIP)((?#protocol)((http|https):\/\/)?(?#subDomain)(([a-zA-Z0-9]+\.(?#domain)[a-zA-Z0-9\-]+(?#TLD)(\.[a-zA-Z]+){1,2})|(?#IPAddress)((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])))+(?#Port)(:[1-9][0-9]*)?)+(?#Path)((\/((?#dirOrFileName)[a-zA-Z0-9_\-\%\~\+]+)?)*)?(?#extension)(\.([a-zA-Z0-9_]+))?(?#parameters)(\?([a-zA-Z0-9_\-]+\=[a-z-A-Z0-9_\-\%\~\+]+)?(?#additionalParameters)(\&([a-zA-Z0-9_\-]+\=[a-z-A-Z0-9_\-\%\~\+]+)?)*)?
here try this.
www.regexlib.com
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
Hi,
I am sending an embedded image in an email. now i want to change some text in the image for every user.
how can i do that ?
Is there any way that i can fetch the text of an image and change it and then embed the new image in the email.
Thanks and Regards,
Kapil Thakur
(Where's there is Kapil , there is a way) - thakur.kapil@gmail.com
|
|
|
|