|
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
|
|
|
|
|
I have finally cracked it. No dummy databinds required or anything other than the findcontrol method.
The key is purely down to using the method at the correct time in the page life cycle.
I used the following to set a textbox to the current date and time.
where:
Formview ID = "Details"
Formview child Textbox to change ID = "Date_AddedTextBox"
(Textbox is in the insert template)
<br />
Protected Sub Details_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles Details.DataBound<br />
<br />
If Details.CurrentMode = FormViewMode.Insert Then<br />
<br />
Dim Test As TextBox = CType(Details.Row.FindControl("Date_AddedTextBox"), TextBox)<br />
Test.Text = Now()<br />
<br />
End If<br />
<br />
End Sub<br />
So ... if like me you have been to hell and back via the entire internet trying to do what seems like the simplest thing, trust your code as it is probably correct and try it at a time where the items have definitely been created and and data definitely bound (such as the event I used above) and you should have success.
|
|
|
|
|
This is how we can open a parent window from a chid window and the beauty to pass parameters
<code>
<a href="#" onclick='window.opener.navigate("forumTopics.asp?forumID=<%=forumID%>");window.close();'>myLink</a>
|
|
|
|
|
The men in the white lab coats are looking for you.
Was this supposed to be a question?
My failometer is detecting vast quantities of FAIL!
"Its SQL - hardly programming..." (Caslen)
|
|
|
|
|
This isn't a question. I was having hard time doing this thing i wanted now I got the answer so I shared it. Somebody will be benefited
|
|
|
|
|
Rather than posting it in a fast moving forum, where it gets swallowed up and forgotten quickly, you could put it in the Wicked Code[^] forum.
My failometer is detecting vast quantities of FAIL!
"Its SQL - hardly programming..." (Caslen)
|
|
|
|
|
huh
|
|
|
|
|
I want users to be able edit a Word document that is on the server. I also want the server to host the Word application. I do not want the client computer to be required to have Word installed. Is this possible or is the only way to do it is to have the client have word installed?
|
|
|
|
|
If it is possible, it would require a third party component. ASP.NET itself plainly cannot do this, with what you get by default. That component would need to convert Word docs to HTML, send them to the client, use JS to create UI like word, then take the result and convert back to Word format. As Word can save as HTML. that may not be as hard as it sounds.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
|
I'm not a Javascript person, so please be kind. I've got an asp.net 2 page that has a master page. I've got a javascript that works fine in a regular asp.net page within the same web. Move it to the page with the master page, and it won't work. Any help appreciated. Also, what's the difference between function setDifference(form) and setDifference = function(form)? Here's the basic stuff:
<script>
setDifference = function(form)
{
var x = document.getElementById('dtTxt1').value;
var y = document.getElementById('dtTxt2').value;
var dt1 = Date.parse(x)
var dt2 = Date.parse(y)
document.getElementById('resultTxt').value = (dt1.valueOf() - dt2.valueOf()) / (60 * 60 * 24 * 1000)
}
</script>
<asp:TextBox ID="dtTxt1" name="dtTxt1" runat="server" onkeyup="javascript:setDifference(this.form);" onkeydown="javascript:setDifference(this.form);" />
<asp:TextBox name="dtTxt2" id="dtTxt2" runat="server" onkeyup="javascript:setDifference(this.form);" onkeydown="javascript:setDifference(this.form);" />
<asp:textbox name="resultTxt" id="resultTxt" runat="server" />
|
|
|
|
|
This is creating a function, which takes form as a parameter, and is called setDifference. I don't think in this instance that it would matter if you removed the = function part. I could be wrong, I am no JS master, either.
What does 'won't work' mean, do you get any errors ? Have you tried using firebug in firefox to debug the script ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Christian,
Won't work means that no calculation takes place. Nothing happens. And, as I'm really unfamiliar with Javascript, don't know how to use Firebug in Firefox to debug.
Janet
|
|
|
|
|
The easiest way to debug is to use alert statements, as in
alert("I got this far);
or
alert("The value of X = " + x);
This will create popup messages. Also, the browser will show you if it thinks there was a js error. So, I'd start with an alert at the top of the function, telling you if it got called or not.
Firebug is an add in for firefox, it lets you set breakpoints in your js and step through. It's awesome.
I would say best guess is that where your script is going, the scope means it doesn't get called, but it's best to go through and make sure that is true.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
When using the master pages, the form elements get rendered with different ID's...I mean to say 'dtTxt1' will be rendered as something 'ctl00_dtTxt1'.
You need to check whether the element ID's that are being used actually exist in the page or not.
So try the following...
var x = document.getElementById('ctl00_dtTxt1').value;
var y = document.getElementById('ctl00_dtTxt2').value;
But before doing this check if the element ID is actually appended with ct100 or some other value.
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|