|
try this
using System.IO;
path = Server.MapPath("../Client").ToString();
File.Delete(path);
|
|
|
|
|
I have master page with several panels and depending on the user configuration I load the childpages on different panels, in other words I move around the ContentPlaceHolder, now, since I started doing that some server controls started to behave strangely, for example a gridview which was working fine now when a row is selected it will say:
============================================================
SelectedDataKey null System.Web.UI.WebControls.DataKey
SelectedIndex 4 int
SelectedRow {System.Web.UI.WebControls.GridViewRow} ...
SelectedRowStyle {System.Web.UI.WebControls.TableItemStyle} ...
SelectedValue null object
============================================================
the SelectedDataKey and SelectedValue are null while SelectedRow is fine.
What happens when I add the ContentPlaceHolder to another panel that is not the original panel that contained it that makes this viewstate issue happen?
I switch the ContentPlaceHolder from panel to panel like this:
=========
PanelX.Controls.Add(mainplaceholder);
or
PanelY.Controls.Add(mainplaceholder);
=========
I'm doing this on "protected override void OnInit(EventArgs e)" of my "main.default.cs".
any help is very much appreciated!
|
|
|
|
|
ThePlagueIsBack wrote: What happens when I add the ContentPlaceHolder to another panel that is not the original panel that contained it that makes this viewstate issue happen?
Hi there. I'm sure that is in fact where a viewState issue would come in. The Panel is an INamingContainer, and child controls within a Panel would be rendered with client ID's that reflect the parent naming container.
I'm not sure I have any advice for you on what to do.
|
|
|
|
|
that makes sense however! I executed the page with the contentplaceholder on the default place and compared the html source with different panel positions and the placeholder has always the same id, every other property is identical.
|
|
|
|
|
I want to add a cancellation-confirm message to the cancel button a wizard control. I'd normally do something this if I could access the button control:
btnMyButton.Attributes.Add("onClick", "javascript:return confirm('Are you sure you want to delete the Internet?')")
Any ideas on how I can access the cancel button in the wizard control to do this? Thanks
|
|
|
|
|
Right click the Wizard component -> "Edit Template" -> "Finish Navigation Template" and create your own button set or whatever you want to put there.
sample template:
<FinishNavigationTemplate>
<asp:Panel BackColor="#E0E0E0" Width="300" Style="padding:3px" Runat="Server">
<asp:Button id="FinishPreviousButton" CommandName="MovePrevious" Text="Prev" Width="60" Runat="Server"/>
<asp:Button id="FinishButton" CommandName="MoveFinish" Text="Finish" Width="60" Runat="Server"/>
</asp:Panel>
</FinishNavigationTemplate>
|
|
|
|
|
|
hi! I have a user control, which consists of a label and a text box. I want to make validation of my user control with standard asp.net validators. I write the following:
[System.Web.UI.ValidationPropertyAttribute("TextBoxValidation")]
public class MyUserControl : System.Web.UI.UserControl
{
public string TextBoxValidation
{
get {}
set {}
}
The question is:
What should be written in the TextBoxValidation setter and getter?
Thanks in advance!
|
|
|
|
|
hi! I have a user control, which consists of a label and a text box. I want to make validation of my user control with standard asp.net validators. I write the following:
[System.Web.UI.ValidationPropertyAttribute("TextBoxValidation")]
public class MyUserControl : System.Web.UI.UserControl
{
public string TextBoxValidation
{
get {}
set {}
}
The question is:
What should be written in the TextBoxValidation setter and getter?
Thanks in advance!
|
|
|
|
|
When i try to connect to sql express database in the project i am getting this error. can anyone help me?
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Thanks annd regards
Hari
|
|
|
|
|
Have you checked the possible cause that is mentioned in the error message?
---
b { font-weight: normal; }
|
|
|
|
|
where can i correct that. i am new to sql express
|
|
|
|
|
Open the Configuration Manager and enable the protocol under Network Configuration.
---
b { font-weight: normal; }
|
|
|
|
|
Hi to all,
I'm trying to invoke a method in ASP from JScript page (OnClick or anything similar to it) on the same related .aspx page with no success.
can someone please explain me how something like that can be done?
|
|
|
|
|
I am not sure about the method but you can fire the event from java script. by using do_postback method.
Sathik
|
|
|
|
|
Hi I hope you can help me with this problem:
Checking the event viewer of a Web Application I have noticed that periodically happens a ViewState Verification fail. It happens several times by day on a diferent .aspx pages. Sometimes it causes an error and the user loses his data, but other times apparently user can continue using the application.
This is the event registered ( I have changed the computer name and the path data, but it's not importante for the question)
COMPUTER_NAME Event code: 4009 <br />
Event message: Viewstate verification failed.<br />
Reason: The viewstate supplied failed integrity check.<br />
<br />
Event time: 10/8/2006 6:54:00 PM <br />
Event time (UTC): 10/8/2006 4:54:00 PM <br />
Event ID: 78a9d00b907b4edab1ac37665fa3175c <br />
Event sequence: 447 <br />
<br />
Event occurrence: 2 Event detail code: 50203 <br />
Application information: <br />
Application domain: /LM/W3SVC/250184202/Root/ApplicationPath-1-128047877472787699 <br />
Trust level: FullApplication <br />
Virtual Path: /ApplicationName <br />
Application Path: D:\Directory\www\ ApplicationName \ <br />
Machine name: COMPUTER_NAME<br />
Process information: <br />
Process ID: 2916<br />
Process name: w3wp.exeAccount name: NT AUTHORITY\NETWORK SERVICE<br />
Request information: <br />
Request URL: http:
Request path: ApplicationName /ApplicationForm.aspx <br />
User host address: 80.66.205.47 <br />
User: USER@application.com <br />
Is authenticated: True <br />
Authentication Type: Custom <br />
Thread account name: NT AUTHORITY\NETWORK SERVICE <br />
ViewStateException information: <br />
Exception message: Invalid viewstate. <br />
Client IP: 80.98.185.47 <br />
Port: 16528 <br />
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 <br />
PersistedState: ML0cSytZ3NNxTv6HMBICK (… Here appears lines and lines of the viewstate dumped) … LecAy+p3fFVSdi7LZEE= <br />
Referer: http:
Path: ApplicationName/ApplicationForm.aspx aspx <br />
Custom event details: <br />
10/8/2006 6:01:15 PM ASP.NET 2.0.50727.0 <br />
Information Web Event 1316 N/A
Any help would be appreciated
Thanks
|
|
|
|
|
hi ,
I have a database table with 3 columns
table1:
eid ename parentid
0 root 0
1 child1 0
2 child2 0
3 gchild1 1
4 gchild2 1
5 gchild3 2
6 gchild4 2
7 ggchild1 3
.... and so on.
now i want to populate the ASP.NET tree view with the table entries by querying the eids and parentids.
i am using ASP.NET 1.1. so i am using microsoft web controls.
TreeView:
Root
---child1
------gchild1
----------ggchild1
------gchild2
---child2
------gchild3
------gchild4
and so on.....
Can some one point to some logic or to some document.
|
|
|
|
|
i am using ASP.NET and C#
|
|
|
|
|
I'll try to make this as simple as possible, it's just to give you some idea...
Table "TreeItems":
item_id, item_parent, item_caption, item_url
Main Code:
[Run Query] SELECT * FROM TreeItems WHERE IsNull(item_parent) OR IsEmpty(item_parent)
[Loop ResultSet]
[Create Parent Node]
RecursiveScan(thisnode, item_id);
[Add Parent Node to Treeview]
[End Loop ResultSet]
RecursiveScan (Parent_Node, ParentId)
{
[Run Query] SELECT * FROM TreeItems WHERE item_parent = @ParentId
[Loop ResultSet]
[Create Child Node]
RecursiveAddNodes(thisnode, item_id);
[Add Child Node to Parent]
[End Loop ResultSet]
}
of course you will have to adapt to your custom table settings and to the treeview control you are using, I've never used microsoft web controls before.
|
|
|
|
|
Sir,
There is a button in the form and the focus is already set on the button.There are few lines of code written on button click.Now the problem is if u press the enter key I don't want to execute the code written on button click.
Please help.
Thanks
|
|
|
|
|
Sir,
How can i delete the history programically in vb.net 1.1.
please help.
|
|
|
|
|
plzzzzzzzzzz help me
In my project nearly 10 to 12 datagrids are there
in datagrid Serial Number binding from the database
based on serial number i have delete the row
suppose there are 5 records if i delete the 3 record the 4th record should swap to 3rd and 5th record to 4th it should update in the database if u know the solution plz help me in swaaping the records in datagrid and database
shivamala
-- modified at 7:31 Monday 9th October, 2006
|
|
|
|
|
Can you explain your question?
Sathik
|
|
|
|
|
i hav to develop a web appliction thn i want to store DataBase in Sql Server2005. in this task i stored DataBase sucessfully.now i want to create a Xml file abut the entered records and whn it'll created thn i want to link this XML into my html pages and show the database value in html page.so wat can i do for tht particular task in asp.net2005. if someone help into this particular thn send me.bcoz if i'll get it thn my project is too much complete.
thnx
smile a lots its costs nothing so keep smiling.
deepak
|
|
|
|
|
In ASP.NET 1.1. I am having a template checkbox column in a dynamically created datagrid. Inorder to maintain the viewstate, i initialize the datagrid in Page_Init itself and modify the datagrid through Ajax Function. The Ajax function will modify the enabled property of checkboxes. After AJAX method is invoked, in next Postback, i'm able to get the checked property of checkbox from Viewstate but not able to get the enabled property from viewstate. But if i don't perform Ajax Modification, in postback i'm able to get both enabled and checked property.
Kindly provide any idea regarding why enabled property is not in viewstate after using AJAX Function
Maha
-- modified at 7:15 Monday 9th October, 2006
|
|
|
|