|
Try this:
put fileupload control and button in two separate update panel and updatemode always.
Cheers!!
Brij
|
|
|
|
|
<form id="form1" runat="server">
<div>
<asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">
</asp:scriptmanager>
<asp:updatepanel id="UpdatePanel1" runat="server" xmlns:asp="#unknown">
<contenttemplate>
<asp:updatepanel id="UpdatePanel2" runat="server" childrenastriggers="False">
UpdateMode="Conditional">
<contenttemplate>
<asp:fileupload runat="server" id="fu1" />
</contenttemplate>
<triggers>
<asp:asyncpostbacktrigger controlid="btn" eventname="Click" />
</triggers>
</asp:updatepanel>
<asp:updatepanel id="UpdatePanel3" runat="server">
<contenttemplate>
<asp:button runat="server" id="btn" text="ok" onclick="btn_Click" width="41px" />
</contenttemplate>
</asp:updatepanel>
</contenttemplate>
</asp:updatepanel>
</div>
</form>
as u told me i do this but not work.
I will do my best?
|
|
|
|
|
Can you show me where is the Closing tag of update panel
Cheers!!
Brij
|
|
|
|
|
thanks for reply and for help
i want to clear you that
i have a grid view in middle panel which having datagrid control when edit and add button is clicked on right panel open edit and add panel and i want that page will not post back so i use ajax(for retriving) so i take datagrid in update panel and all panel related to that grid have another update panel.
as you answer that i have this fileupload and button on other update panel(seprate panel) than application work like firstly edit your all info and after that go for new menu if he want to edit image also. for this reason i cant take this in seprate panel.
please tell me what to do on this condition?
I will do my best?
|
|
|
|
|
|
thanks to reply but error is shown:-
Control with ID 'btn' cannot be registered through both RegisterAsyncPostBackControl and RegisterPostBackControl. This can happen if you have conflicting triggers associated with the target control.
I will do my best?
|
|
|
|
|
hi,
i am not very much clear for your question but as per your question what i can suggest you is
1> First put all the update panels in one updatepanel and
set childrenastriggers=true and updatemode=always
2> Put both the controls in one updatepanel only..
Reasons are not Important but Results are Important.
Swati Tripathi
|
|
|
|
|
Thnaks to reply
yes i have already done this but problem is that i am use debug and found that fileuplod.filename is empty means it can't get file name. while i am selecting a .jpg file.
I will do my best?
|
|
|
|
|
hey please check your triggers.
Reasons are not Important but Results are Important.
Swati Tripathi
|
|
|
|
|
thanks for reply
& if trigger change in place of ascncronys into autopostback than page will refresh and i dont want that my page will refresh another wise its working properly and then where i use ajax for this control. here is any other way that page will not refresh and work is done properly.
I will do my best?
|
|
|
|
|
how can i save DataGridView Data into excel sheet in windows. plz help.
|
|
|
|
|
plz go thru this link
http://xldennis.files.wordpress.com/2008/02/dgviewcode3.png
|
|
|
|
|
Worksheet shall be created only once. after that new rows shall be inserted in it like it is done with sql. is this code like that.
|
|
|
|
|
hi
well i am looking for the expression validator for this kind of string
aa1_aa2_aaa
if anyone could help......
|
|
|
|
|
You could search about Regular Expression.It is simple.
studing is processing in this life.
|
|
|
|
|
hi,
try this one.
^(([a-zA-Z\d]{3}_){2})([a-zA-Z\d]{3})
It will check for aplhanumeric strings seperated.
Can U give more examples of the type of string you want?
Hope to be of help.
take care
mani
|
|
|
|
|
Do you mean that the first two should end with a digit:
([a-z]{2}\d_){2}[a-z]{3}
or that the first two can contain digits:
([a-z\d]{3}_){2}[a-z]{3}
or that all three can contain digits:
([a-z\d]{3}_){2}[a-z\d]{3}
?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
You can search for Regular Expressions here:
Regex Lib[^]
-muneeb
A thing of beauty is the joy forever.
|
|
|
|
|
I don't need to search for a regular expression. You should reply to the original post.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Sorry, I don't want to hurt you. Infact I was replying to the orignal post.
Is there any way to move my post to the orignal post?
-muneeb
A thing of beauty is the joy forever.
|
|
|
|
|
Plz tell me the name of dll which is provided by microsoft
for databaseconnectivity in dotnet
from where i can download that
|
|
|
|
|
nikhil1234 wrote: Plz tell me the name of dll which is provided by microsoft
for databaseconnectivity in dotnet
from where i can download that
Download it from here.Enterprice Library
please don't forget to vote on the post that helped you.
|
|
|
|
|
Hi,
I have a class marked as [Serializable] named "TestClass". When i store the object of this class
Why the [NonSerialized()] attribute fname successfully serialized and deserialized back when i create the object from viewstate?
Following is the full code of my test.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Runtime.Serialization;
using System.Xml.Serialization;
public partial class viewstate : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
TestClass obj = new TestClass();
obj.name = "Dreams";
obj.fname = "Lonely";
ViewState["MyDT"] = obj;
}
protected void Button1_Click(object sender, EventArgs e)
{
TestClass obj = (TestClass)ViewState["MyDT"];
Response.Write("id=" + obj.j.ToString() + " Name=" + obj.name.ToString() + " Age=" + obj.age.ToString() + " fname="+ obj.fname +"");
}
}
[Serializable]
public class TestClass
{
public int j = 1;
public string name = "Dreams";
public string age = "28";
[NonSerialized()]
public string fname = "Planet";
}
Thanks
|
|
|
|
|
Hi,
First you need to Serialize the TestClass object.
Here is how to do it.
Serialization
TestClass obj = new TestClass();
obj.name = "Dreams";
obj.fname = "Lonely";
FileStream fs = new FileStream("SerializedString.Data", FileMode.Create);
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(fs, obj);
fs.Close();
Then you need to deserialize it like this.
Here is the code for that.
Deserialization
FileStream fs = new FileStream("SerializedString.Data", FileMode.Open);
BinaryFormatter bf = new BinaryFormatter();
TestClass obj= (TestClass)bf.Deserialize(fs);
fs.Close();
Response.Write("id=" + obj.j.ToString() + " Name=" + obj.name.ToString() + " Age=" + obj.age.ToString() + " fname="+ obj.fname +"");
Hope it helped.
Thx,
Gayani
|
|
|
|
|
I agreed.
But storing object into the viewstate is also the process of serialization. If i removed the [Serializable] attribute from TestClass the application won't work, because to store the object, class must have that attribute.
Than why that process won't understand [NonSerialized()] attribute?
Is viewstate serialization is different form of process?
Thanks,
|
|
|
|