|
iam having a server image button .with some image ..now i want to change the image url of the image buttton using javascript
|
|
|
|
|
If it's a server side control, it's Id in not the Id you specified, unless it has no controls above it in the tree. Write a js variable into your page with the ClientID, then you can use that the same as you would the id of any img tag with js.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
jagadeeshkumar2106 wrote: server image button
For the Image Button's ClientID, you can use document.getElementByID function in JavaScript to set a new Image appropriately.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Except, like I said, if it's a server control, he won't know the client Id at the point of writing the code, it can change depending on where the control is in the page control tree.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi all
i have a problem with child window.
i have a child window with the name brand.aspx
In brand page iam adding a new brand and then exiting form the page.
and now i have a brand dropdown in parent window...
after exiting form the child window newly entered brand is not immediately binding to the brand dropdown in parent window.
if i refresh the page then it is adding but i want to bind immediately
this is the code i wrote in child window exit button
Page.ClientScript.RegisterStartupScript(Me.[GetType](), "close", "self.close();")
can u help me in this issue...
Thanks in advance
siri
|
|
|
|
|
U will have to do like this on parent window:
var winSettings = "dialogWidth:400px;dialogHeight:250px; help: no; status: no;directories:no,menubar:no";
var values = window.showModalDialog("brand.aspx?no=" + brandno + "&name=" + brandname, " ", winSettings);
if(values == 1)
{
window.location.reload();
}
so that it will refresh the page accordingly...
Hope it solves ur problem....
|
|
|
|
|
You just need to write some javascript into the body tag of the pop-up page after the submit has been processed, like this:
If <<record added="" test="">> Then
Response.Write ""
Response.Write ""
Response.Write ""
Else
see link http://p2p.wrox.com/topic.asp?TOPIC_ID=5956
Bindiya
|
|
|
|
|
in child window java script u write
window.opener.document.getElementbyid("parentcontrl").value=child control value
|
|
|
|
|
How to limit quantity of the chosen items in checkboxlist ?
thx
stepan
|
|
|
|
|
Javascript. The way I'd do this is to add an oncheckchanged ( or whatever it is ) event to each checkbox, and keep count of how many items have been checked. IF too many are checked, reject the click and show a message.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I would like to find out how to convert HtmlTextWriter to either a string or a stream? I am working with an application that requires this to be either in a string or stream format and I can't seem to accomplish this. ToString only gives me the object name. Any assistance would be appreciated. Current language is C# but VB is fine.
Thanks,
Leo T. Smith
Senior Programmer/Analyst
|
|
|
|
|
I would like to add one thing. All I am trying to get is the whole page response file in a string before I send it to the browser. I really don't want to iterate through all the controls and build the page manually.
Thanks,
Leo
Leo T. Smith
|
|
|
|
|
Are you trying to get the full raw HTML response for the entire page or for just a control?
|
|
|
|
|
Yes I want the complete raw html, like you would see in a text editor, or by going view source.
Thanks,
Leo T. Smith
|
|
|
|
|
Create a StringWriter and create the HtmlTextWriter using that. The ToString method of the StringWriter returns what's written to the HtmlTextWriter as a string.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Is there a function call to convert a current HtmlTextWriter to a StringWriter before using the ToString function in the StringWriter?
Thanks,
Leo T. Smith
|
|
|
|
|
Cast the InnerWriter property to StringWriter (assuming of course that the HtmlTextWriter is actually based on a StringWriter).
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
|
Does anyone have any advice regarding running a background processes or threads in an ASP.NET application. I know it's possible to kick off a background process by responding to Application_Start events in the Global.asax file and using some sort of singleton class.
I basically want a task scheduller that kicks off at a certain time without any user intervention and sends emails, or writes to a database etc. The main issue I have is how to keep it running because the ASP.NET AppDomain can get reset or shutdown for a number of reasons, such as when there's no user activity. So my main question is how could I keep it running? I read somewhere someone suggesting getting the background process to do an HttpWebRequest it's own website, thus keeping the AppDomain running, would this work do you think?
Also I know about running a Windows Service, but since I'm on shared hosting this isn't an option.
Many thanks for your help!
|
|
|
|
|
I am trying to loop though the contents of a formview and depending on the control type do something. My formview doesn't pick up all the content inside of the table. Basically I am just going to have a reset button that loops through and sets the text to "". Thoughts?
<asp:FormView ID="FormView1" runat="server">
<ItemTemplate>
<table>
<tr>
<td>Hole1</td>
<td>Hole2</td>
</tr>
<tr>
<td><asp:textbox ID="txtScoreHoleOne" runat="Server" /></td>
<td><asp:textbox ID="txtScoreHo" runat="Server" /></td>
</tr>
</table>
</ItemTemplate>
</asp:FormView>
|
|
|
|
|
Is using an <input type='reset' /> button not an option?
|
|
|
|
|
I have a pretty big website where website configurations are written in separate XML files(not in web.config). I have a class which reads this configurations. This configurations will be same for all the visitors.
So I am looking for a method to cache this classes instance for improved performance. But since I am using this class inside my business layers, I don't have access to the Page object. Is there anyway to cache it and get it back without using Page object ? Any help would be appreciated
|
|
|
|
|
As far as i remember you can access the cache using the httpconext
httpcontext.current.cache.add, etc
Hope that helps
|
|
|
|
|
Thanks, But I guess, I don't have handle to HttpContext class inside my class.
|
|
|
|
|
You will have, as long as the class is called from a web site you will be able to access httpcontext.current.cache, .request, .response and all that stuff... Give it a try
|
|
|
|