|
The above code is working for me in the page load event.
Are you calling the above code in the page load event in both pages.
|
|
|
|
|
No, below is the code structure
protected void Button1_Click(object sender, EventArgs e)
{
if(......)
{
..
..
}
else
{
..
Page.Controls.Add(new LiteralControl("<script language='javascript'> window.alert('My Message')</script>"));
}
}
xxx
|
|
|
|
|
if understood correctly, you are trying to register the javascript to display an alert message at runtime .
You can also try like this:
Page.ClientScript.RegisterStartupScript(this.GetType(), "testkey", " window.alert('My Message')");
|
|
|
|
|
Although you did not have any explanation as to why i encountered such problem, I am still very greetful that you share your knowledge... thanks a lot!!!
I salute
xxx
|
|
|
|
|
Hi,
I am trying to display MS Word document in the webpage and I am using iframe to display. When I put document file (which is under the project folder), it shows in the page but if I include the file path, the document doesn't diplay in the frame. So I tested the same code in notepad, save as .htm format and then it works. I don't know what's the problem. Anyone have idea to solve this problem. My code is:
<FRAME WIDTH="500px" HEIGHT="500px" NAME="fframe" SRC="">
<EMBED SRC="" width="500px" height="500px"></embed>
|
|
|
|
|
If your document is under the project folder(application folder), then specify the src attribute using relative url like src="/Project/testMailMerge.doc'
|
|
|
|
|
My document is not under project folder. It is in another folder. The problem is if I use notepad and save the page in html format, the document is opened but with asp page it didn't work. Any more idea?
|
|
|
|
|
hi all..
I have an asp:dropdownlist on that page.
After an UpdatePanel async postback, the DropDown stops working. it is clickable but does not open up (or drop down).
If you click somewhere else on the page, then click again on the dropdown then it expands, but the value does not change.
Then, if I switch to another Browser window or another application then come back, Voila! it has become ok. The dropdown now works completely normal.
This all has started happening recently only in Firefox. All other browsers including IE 7, Chrome, Safari don't have this issue and work perfectly fine.
can you help me on this
Thank you.
siri
|
|
|
|
|
|
i have deployed a web application where i have out session timeout in web.config
<sessionState cookieless="false" timeout="330"/> and in state management in ASP.net configuration settings on IIS.
after this the application still time out before the defined time. Any ideas?
|
|
|
|
|
Did you check if your web.config timestamp got inadvertantly updated by any applications?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
|
What is the SessionState Mode ?
Here is one of my article on session, Hope this will give you some more idea on session.
Exploring Session in ASP.Net
|
|
|
|
|
|
Are you deleting any sub folder under the application root folder in your asp.net code. If so, it will restart the AppDomain.
Check this link[^]
modified on Wednesday, May 13, 2009 3:29 AM
|
|
|
|
|
You have configured 330 but Can you tell what is actual timeout and what is session mode u r using?
|
|
|
|
|
Hi I have nested gridviews bounded to data tables. On child gridview delete event I'm trying to fetch the parent gridview row index somehow to fetch the child gridview through find control and databind it to show the updated changes. However I am fetching the the wrond index through my code as its returning the row number of the child and not the parent. Here's my row delete event for the child.
protected void gvSec_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
GridView gvtmp = (GridView)gvComp.Rows[e.RowIndex].FindControl("gvSec");
DataTable tmpdt = (DataTable)ViewState["SecTab"];
if(tmpdt!=null)
{
tmpdt.Rows.RemoveAt(e.RowIndex);
}
gvtmp.DataSource = tmpdt;
gvtmp.DataBind();
ViewState["SecTab"]=tmpdt;
}
|
|
|
|
|
Try the following code. You can get the parent GridView row by
((GridView)sender).Rows[e.RowIndex].Parent.Parent.Parent.Parent
Also you can get the control or cells value of the parent gridview using
((GridView)sender).Rows[e.RowIndex].Parent.Parent.Parent.Parent.Controls[0] collection
|
|
|
|
|
Thanks for the reply Mr. Ramesh. It solved my problem, can you please explain a little how this Parent.Parent works ? I mean logically .
((GridView)sender).Rows[e.RowIndex].Parent.Parent.Parent.Parent
How does .NET drill down the parent by using this parent property/method ?
Thanks, Mike.
|
|
|
|
|
Is there any built in function in ASP.NET Like print_r in Php which displays information about a variable in a way that's readable by humans.
|
|
|
|
|
The question is where you want to display this text? if its on the browser with nothing you can use Response.Write() function to write whatever you want on the rendered output.
Sincerely Samer Abu Rabie
Imagination is more important than knowledge !
|
|
|
|
|
Hi,
I must have searched every forum on the internet and tried every custom function going to try gain control over textboxes in the insert template of my formview using VB code behind without any success and its starting to bug me.
Consider the following scenario:
If I have a formview with ID: "Details"
and a textbox called: "CampaignTextBox" in the <insertitemtemplate>
and wish to set the .text value of "CampaignTextBox" to "Hello World"
I believe the most obvious method is as follows:
<br />
Dim Dynamic_Text As TextBox = CType(Me.Details.FindControl("CampaignTextBox"), TextBox)<br />
Dynamic_Text.text = "Hello World"<br />
It doesn't matter how I manipulate this code I cannot get my code to find the control - I get a null reference exception - "Object reference not set to an instance of an object.."
Other details about my page that may affect this (possibly):
1-It is a page that uses a master page, does this cause issues?
2-If my formview is within a div would this make any difference?
Could anyone give me any clues or if at all possible an example using the parameters given above and save me from going bald before I get to 30?
Thanks
Andy
|
|
|
|
|
In case anyone suggest these, I have also just tried omitting "Me"
<br />
Dim Dynamic_Text As TextBox = CType(Details.FindControl("CampaignTextBox"), TextBox)<br />
and trying to add the extra level of "row"
<br />
Dim Dynamic_Text As TextBox = CType(Details.row.FindControl("CampaignTextBox"), TextBox)<br />
and experience the same problem.
|
|
|
|
|
ur coding is correct but u need to make dummy binding to form view to make it build control hierarchy.
try this in page load,
If Not Page.IsPostBack Then
Dim arr As New ArrayList()
arr.Add(1)
Details.DataSource = arr
Details.DataBind()
End If
|
|
|
|
|
Hi,
thanks for your reply.
When I try the code in the page load event I get the following error:
"Both DataSource and DataSourceID are defined on 'Details'. Remove one definition"
What could cause this error message in this context?
I don't understand the need to create a dummy binding. Would you mind explaining as if I understand it I may be able to figure out where I'm going wrong?
Cheers
Andy
|
|
|
|