Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
5
Reply
jquery with dialog confirm
Kev Patil
Feb 22 2016 2:32 PM
444
Reply
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
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
Print PDF with iTextSharp
Dynamic Paging For DataList Control with PagedDataSource