|
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".
|
|
|
|
|
|
Hi friends...
We are developing online exam webpage using asp.net.
When the exam starts (When page loads at the first time), duration of test will be displayed( for example: for 30.00). As the time passes on the duration would be decreased like 29.59, 29.58....
We are displaying one question per page. When user clicks on next button for next question, the timer is getting refreshed like displaying 30.00 again. we are displaying time in tag client side.
The issue is the timer value should not be refreshed when the user clicks on next button or previous button.
Please shed some light on this so that I can get rid of this issue.
Thank you,
Shah_Tech
|
|
|
|
|
Why don't you use ajax panel to diplay the date and put the timer outside the update panel?
If you cannot use ajax for some reason or the other, then check if you can get the current value of the timer on the post back and set it as the timer starting value in the next page.
Otherwise, use frames! Not advisable!
HTH!!
|
|
|
|
|
You need to keep the time value safe.
This can be done as
1. Keep the hidden TextBox(Style="display:none") on the web page
2. Save the initial value of exam in the text box
3. For your timer control, fetch the timer value from this text box, subtract the value, display it to user and save the reduced value back in the text box.
4. When user clicks on the next button, fetch the value from the text box, pass it to the next page, save it in Hidden text box and start the timer from value in text box.
I think this will help you.
|
|
|
|
|
plz provide me 1 project related to asp .net
if possible .. plz help me....
u can send me mail on --- meshekhar123@rediffmail.com
Shekhar Kadam
9594908752
|
|
|
|
|
Shekhar Kadam wrote: plz provide me 1 project related to asp .net
Is this your home assignment ?
You should not ask like this. If you want to learn you have to comes up with some idea, on which you want to develop. You should ask for suggestion rather than asking complete project.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
How about a project to do homework assignments for other people for free?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
hi......
i have used paypal functionality in my project....
i have used the following code:
<form action="<%Response.Redirect("https:
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="bussiness" value="xyz@xyz.com" />
<input type="hidden" name="item_name" value="Tanzanite" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="amount" value="100.00" />
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
</form>
but before loading the form it directly redirects to paypal....plz guide.
i want that first the form load and after clicking on the image the form reidrects to paypal.
|
|
|
|
|
mylogics wrote: " method="post">
Remove the server script <%Response.Redirect("https://www.sandbox.paypal.com/cgi-bin/webscr")%> from the code. Just have <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> . It should work.
HTH
|
|
|
|
|
no it doesnt work until i use resonse.redirect.....
|
|
|
|
|
Putting response.redirect on the form would redirect the page even before the rendering is complete!
BTW, I missed a couple of things when posting last time! Sorry.
Here is your solution -
* Remove the Response.Redirect from the Form.
* Form action would be invoked only when a submit button is clicked. So, no use setting action for your case.
* Surround your image with a hyperlink tag like below -
<a href="https://www.sandbox.paypal.com/cgi-bin/webscr"><input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" /></a>
HTH
|
|
|
|
|
no it didnt worked nway thanks........
|
|
|
|
|
What happens when you do the changes that I've suggested?
|
|
|
|
|
at localhost when i run it i get the following error...
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
while running online it the page just get postback without showing any error.
|
|
|
|
|
Can you post the update code as well, so that I check if it is missing anything?
|
|
|
|
|
<form id="payForm" action="" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="bussiness" value="xyz@xyz.com" />
<input type="hidden" name="item_name" value="Tanzanite" />
<input type="hidden" name="currency_code" value="USD" />
<a href="https://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="amount" value="100.00" />
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
</a>
</form>
either i give the url in form action or not it makes no sense....
|
|
|
|
|
<form id="payForm" action="" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="bussiness" value="xyz@xyz.com" />
<input type="hidden" name="item_name" value="Tanzanite" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="amount" value="100.00" />
<a href="https://www.sandbox.paypal.com/cgi-bin/webscr">
<img border="0" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif"
alt="Make payments with PayPal - it's fast, free and secure!" />
</a>
</form>
Try this! it works!
HTH!!
|
|
|
|
|
thanks alot it works..............
one more question if i want to provide the values dynamically what shud i do in this code.
like wan to give email,amount etc.... dynamically...
|
|
|
|
|
Assuming you get the values from some data source on the server, just put the values from the server side code.
|
|
|
|
|
how to convert binary data sotred as blob data field in mysql db to readable ata format and store it to file
|
|
|
|