|
You cant do that ...
Even ASP.NET cant do this, thus it cant retain its value during postbacks..
Sorry.. You need to store it in server as soon as you find it in server. And then show the message, file uploaded successfully.. .or so...
|
|
|
|
|
still confusing.. How to store(session or any string variable) and assign to to fileupload control...
|
|
|
|
|
As I already told you, even if you set the value of a FileUpload control, it cant assign the appropriate file pointer to the browser.
So dont try to do this, rather when user choose the file, upload to the server immediately and work from the file placed in the server.
Cheers.
|
|
|
|
|
Hi,
How can we update all resource files contents in asp.net(2.0) pages?
is there any way in asp.net (2.0)?
Waiting for your reply
Known is a drop, unknown is an ocean
modified on Thursday, December 17, 2009 2:31 AM
|
|
|
|
|
Do you really expect a reply after the edit??
|
|
|
|
|
Hi EveryBody,
I got solution for this problem
this is the way
{
XmlDocument obj = new XmlDocument();
XmlNode rootNode;
obj.Load("E:\\Language\\App_LocalResources\\Default.aspx.resx");
rootNode = obj.SelectSingleNode("root");
foreach (XmlNode Node in rootNode)
{
string str = Label1.Text;
string txt = TextBox1.Text;
if ((Node.Name == "data") && Node.Attributes["name"].Value == "Label1Resource1.Text")
{
Node.SelectSingleNode("value").InnerText = txt;
}
}
obj.Save("E:\\Language\\App_LocalResources\\Default.aspx.resx");
}
Known is a drop, unknown is an ocean
|
|
|
|
|
Its Happy to share with all..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
I m making role based security with forms authentication in that, to make the role authentication work for forms authentication i modify web.config file like this:-
<configuration>
<system.web>
<authentication mode="Forms">
<forms name="MYWEBAPP.ASPXAUTH"
loginUrl="login.aspx"
protection="All"
path="/"/>
</authentication>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
<location path="administrators">
<system.web>
<authorization>
<!-- Order and case are important below -->
<allow roles="Administrator"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<location path="users">
<system.web>
<authorization>
<!-- Order and case are important below -->
<allow roles="User"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<configSections>
.
.
.
.
.
.
.
</configuration>
and with this coding i m getting this error:
only one element allowed per config file and if present must be the first child of the root element.
plz help me with this error
|
|
|
|
|
I also faced this problem in the beginning..! this is due to presence of other config section..!
Check your config section there will be 2 config sections after debugging .!
keep one in comments or delete it..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hi all
When i am declaring String type variable.
What shaould i use
String OR string
Is this effect on performance.
Thanks and regards,
Amit Patel
|
|
|
|
|
Even I'm not sure! When I once asked this to one of the MCTs that I know, he said its better to use "String" for declaring string type variables, but he wasn't able to give me any reasons either! But, I rarely use String/string type variables. I use StringBuilder for all string manipulations.
|
|
|
|
|
Dinesh Mani wrote: But, I rarely use String/string type variables. I use StringBuilder for all string manipulations.
StringBuilder is usefull when you are doing a large string ( inside loops ) operation. For Small operation its always preferable use string not stringBuilder.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I just use StringBuilder when I know that a specified string is going to be modified more than 2 times after the original assignment, otherwise I use general String/string. I guess its just general preference!
|
|
|
|
|
Dinesh Mani wrote: use "String" for declaring string type variables
Apart from having that sort of coding guidelines, I see no reason of doing that.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Hi
String is a .net data type
string is a C# data type
I think that there is no difference.
My Reason:
right click on the string and select "Go To Definition" from string's context menu
it refers to String definition
Mohammad Khansari
|
|
|
|
|
string is an Alias for System.String . IL version of both string and String is System.String. So there is no difference between them.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
No differece. Both are same.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
I m making role based security with forms authentication in that, to make the role authentication work for forms authentication i modify web.config file like this:-
<configuration>
<system.web>
<authentication mode="Forms">
<forms name="MYWEBAPP.ASPXAUTH"
="" loginurl="login.aspx" protection="All" path="/">
<authorization>
<allow users="*">
<location path="administrators">
<system.web>
<authorization>
<allow roles="Administrator">
<deny users="*">
<location path="users">
<system.web>
<authorization>
<allow roles="User">
<deny users="*">
<configsections>
.
.
.
.
.
.
..
<configuration>
and with this coding i m getting this error:
only one <configsections> element allowed per config file and if present must be the first child of the root <configuration> element.
plz help me with this error
|
|
|
|
|
Your web.config is not pasted properly. Please check "Do not interpret HTML tags (good for code snippets) " before post config code.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
ya i have done that see my modified code above
|
|
|
|
|
Hi,
I am facing a problem with the validator. Required field validator is not displaying error message for the control dropdown. am binding dropdown with the datatable. and set the initial value property as "select product" in the required field validatior.If i didnot select any thing from ddl and click button its not showing any error message...below is my code.
// Binding the dropdonwn with the data table
DataTable datatable = GetDataFromDB("SP_GetProducts", "All");
DropDownList2.DataSource = datatable;
DropDownList2.DataTextField = "Product Name";
DropDownList2.DataValueField = "Product ID";
DropDownList2.DataBind();
DropDownList2.Items.Insert(0, "Select Product");
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True"
Height="22px" Width="234px">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="DropDownList2" Display="None"
ErrorMessage="Please select the product" InitialValue="Select Product" ValidationGroup="Calculation"
>*</asp:RequiredFieldValidator>
<asp:Button ID="Button1" runat="server" Text="Calculate" Height="22px"
onclick="Button1_Click" ValidationGroup="Calculation" />
can any one tell me where I was wrong...
|
|
|
|
|
Validator controls are case sensitive! So, select product and Select Product are different!
HTH!!
|
|
|
|
|
yes I gave the same... pls check in the code once again.... but button_click event is not firing if we don't select anything from ddl... only the issue is its not displaying error message....
|
|
|
|
|
I'm sorry, I just checked the text and the DDL definition! My bad!!
I think you should change the Display property on the validation control from Display="None" to Display="Dynamic".
|
|
|
|
|