TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
271
36k
if condition is right then goes to next page in asp.net
Oct 16 2020 2:10 AM
hi experts...
my scenario is when user enter its right answer then it goes to next page otherwise shows an error "incorrect error"
<table>
<tr>
<td>Security Question1</td>
<td>
<asp:DropDownList ID=
"ddlQuestion"
runat=
"server"
AppendDataBoundItems=
"true"
>
</asp:DropDownList>
<asp:TextBox ID=
"TxtAnswer"
runat=
"server"
></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Button ID=
"btnSubmit"
runat=
"server"
Text=
"Submit"
OnClick=
"btnSubmit_Click"
/>
</td>
</tr>
<tr>
<td>
<asp:Label ID=
"lblerror"
runat=
"server"
></asp:Label>
</td>
</tr>
</table>
protected
void
btnSubmit_Click(
object
sender, EventArgs e)
{
using
(var context =
new
schoolEntities6())
{
string
username = Request.QueryString[
"username"
];
var user = (from c
in
context.SecurityQuestions
where c.SecQue == ddlQuestion.SelectedItem.Value
select c).FirstOrDefault();
if
(user !=
null
)
{
schoolEntities6 db =
new
schoolEntities6();
Session[
"UserName"
] = username;
Response.Redirect(
"/ChangePassword.aspx?username="
+ username);
}
else
{
lblerror.Text =
"incorrect answer"
;
}
}
}
I am using this way to execute but doesn't work...
Reply
Answers (
1
)
Italic, bold text in XtraReport ?
About using Ado.net with listbox in asp.net core!!