|
Have a label to show the error message.Initially hide it, and show the when there is an error..
Are you asking something else?
|
|
|
|
|
once i click on the button in modal up it disappears whether textbox value is matches or not... I want to display in modal pop up itself if textbox value is false....
|
|
|
|
|
there must be postback on button click,after postback the modelpop will hide.Do one thing ,Attach a clientside event, validate the request if there is an error, show from javascript itself. and if there is no error continue with postback.
|
|
|
|
|
You can also solve this "issue" by calling the Show Method of the extender again within you button click-event (when you're also setting your error-message). This prevents the modal-popup from hiding.
Example:
if (error)
{
lblError.Text ="Something is wrong";
myPopupExtender.Show();
}
else
{
}
Michael
|
|
|
|
|
Hi.
On a button click i'm opening a page with showModalDialog,
depending on the value returned from modal dialog,
i want to clear contents of asp.net controls.
These controls are read only controls.
But i'm unable to clear the controls.
Please guide me how to resolve this issue.
Thanks in Advance.
|
|
|
|
|
Find the element on the page via JavaScript and clear it appropriately
document.GetElementById("somecontrol").value = "";
of JQuery
$("#somecontrol").val("");
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi.Thanks for you reply.
document.GetElementById("somecontrol").value = "";
this code is valid,but in my case i'm unable to do it,
var URL = 'AddParticipant.aspx?Id='+EventId+';<br />
retVal = showModalDialog(URL, false, "dialogHeight:700px;dialogWidth:900px;scroll:yes;");
I'm able to retrieve the value well. after that i wrote following
document.getElementById("<%=txtOrderNo.ClientID%>;").value="";
But i'm unable to clear the content. and the textbox is readonly, and the page is in side updatepanel.
Does it have anything to do..
Thanks again
|
|
|
|
|
Remove the semicolon after the binding expression
document.getElementById("<%=txtOrderNo.ClientID%>;").value="";
it should be this
document.getElementById("<%=txtOrderNo.ClientID%>").value="";
The former is adding the semicolon to the id which of course can't be found in the dom.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Pls how do i prevent page reload each time i select an item from drodownlist whose postback is set to true.
thank you.
|
|
|
|
|
This can be easily done by using AJAX. Use AJAX Update panel and place your dropdown list inside update panel.
Cheers !
Abhijit
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
use ajax update panel
Ravie Busie
Coding is my birth-right and bugs are part of feature my code has!
_________________________________________
Me
Facebook
Twitter
|
|
|
|
|
Completely true..
Use AJAX Update Panel.
jaypatel512
|
|
|
|
|
You should use ajax with update panel
Farogh Haider
Web developer
|
|
|
|
|
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
}
}
public class test
{
string strID;
public string hello()
{
strID= this.txtTextBox1.Text; //here i am confused with my basic concept (can i assign value to strID from TextBox and if yes then how to get TextBox Value from form2 because I am making a new class here)
return strID;
}
}
}
|
|
|
|
|
How this is related with ASP.NET ? This is your Windows Application ..
Cheers !
Abhijit
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Create a static class with global var,
in you form 2, asign the value of text box to the var,
you can use the value anywhere you want by refrencing the class and the varibale.
hope this helps.
|
|
|
|
|
What do you intend to do with the test class? (choose better names like MyTestClass so you don't accidentally use reserved words)
You should create a public property in your MyTestClass for the strID. (Tip: type prop and hit tab twice). Create an instance of your MyTestClass in the form load of Form2 and then you can set the TextChanged event of txtTextBox1 to set the value of that property.
You might want to do some reading on object oriented programming. From what you have written it looks like you are used to procedural programming. Try this one C# Tutorial - An Object Oriented Approach to Programming[^]
|
|
|
|
|
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
test t1 = new test(); //Create an instance of test class.
t1.hello(textbox1.text);
}
}
public class test
{
string strID;
public string hello(string message)
{
strID= message; //here i am confused with my basic concept (can i assign value to strID from TextBox and if yes then how to get TextBox Value from form2 because I am making a new class here)
return strID;
}
}
}
jaypatel512
|
|
|
|
|
the question is not clear what exacly do u want to do, do you have two forms, or are u requesting the valu from the same form.
you can use a command button and put your code in the click event of the button.
hope this helps.
|
|
|
|
|
Hey guys,
I have implemented a
<input type = "file" runat ="server"/>
so that user can select files.
Also I would like to add a file prefix e.g. .txt, .csv or .cs
so that only these kinds of files will be allowed. I can't get this right.
I tried
<input id = "files" type = "file" accept = "text/csv, text/txt, text/cs" runat = "server"/>
and it won't work....
Anybody there with a little help
Please help
Morg
|
|
|
|
|
MorgSim wrote:
You can use ASP.net fileupload control, no need to use input type='file'.
MorgSim wrote:
What you can do is use validation control which will check the file extension, and validate it.
Hope this help.
|
|
|
|
|
And remember that regular expressions are case sensitive
(.*?)\.([cC][sS][vV]|[tT][xX][tT]|[cC][sS])$
|
|
|
|
|
Thanks you all guys that was helpful
|
|
|
|
|
Hy,
I have a requiremnet in wi=hcih i hav to get a file from the client server and place it in my local machine.
the file may be of any type
thanks in advance,
raghvendra Panda
|
|
|
|
|
With ASP.NET you will not be able to push the file, you must make it available for the user to download. Place a link to the file on your page.
I know the language. I've read a book. - _Madmatt
|
|
|
|