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
Kev Patil
NA
21
4.2k
jquery with dialog confirm
Feb 22 2016 2:32 PM
I have the following sql select code, where im trying to get value and i would like to ask user to continue if value is found or start new.
var getJOB = txtJobNo.Text;
try
{
MGMT_CON.Open();
MGMT_COM =
new
SqlCommand(
"SELECT [job],[revno] FROM [MATRR] WHERE [job] = '"
+ getJOB +
"'"
,
MGMT_CON);
var sqlRRev = MGMT_COM.ExecuteReader();
if
(sqlRRev.Read())
{
//ask user if want to continue
//if wants to continue use the value from sql
//else write something else into textbox
//if reads get the revno from sql and convert into int
var revno = Convert.ToInt32(sqlRRev.GetValue(1).ToString());
//write mrr based on revno
ddlRR.Text =
"BBB-"
+ getJOB +
"-"
+ (revno + 1);
}
else
{
ddlRR.Text =
"BBB-"
+ getJOB +
"-"
+ 1001;
}
MGMT_CON.Close();
}
catch
(Exception e)
{
ClientScript.RegisterClientScriptBlock(GetType(),
"alert"
, e.Message);
}
I tried looking around for different solution, one was trying jquery but im not familiar with it.
<script>
$(
function
() {
$(
"#dialog-confirm"
).dialog({
resizable:
true
,
height: 140,
modal:
true
,
buttons: {
"Use New"
:
function
() {
$(
this
).dialog(
"close"
);
},
"Continue"
:
function
() {
$(
'#<%=Label1.ClientID%>'
).html(
"hello"
);
/* but sometimes i would need to calculate (adding or subtracting) */
$(
this
).dialog(
"close"
);
}
}
});
});
</script>
please help.
Thankyou
Reply
Answers (
5
)
Print PDF with iTextSharp
Dynamic Paging For DataList Control with PagedDataSource