RecipeDan
asked on
Ajax Toolkit to JQuery
I have been trying to convert scripts that I have in AJax Toolkit to JQuery. How to I get the spinner to read values from a database? Below is how I set it up the NumericUpDownExtender in Toolkit but I am at a loss on how to use spinner to read values from a database
public void TimeList()
{
SqlConnection conn;
SqlCommand comm;
SqlDataReader reader;
string connectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
conn = new SqlConnection(connectionString);
comm = new SqlCommand("SELECT FollowupTime FROM S_Setup", conn);
try
{
conn.Open();
reader = comm.ExecuteReader();
if (reader.Read())
{
string Followup = reader["FollowupTime"].ToString();
NumericUpDownExtender1.Minimum = Convert.ToDouble(Followup);
NumericUpDownExtender1.Step = Convert.ToDouble(Followup);
}
reader.Close();
}
finally
{
conn.Close();
}
}
ASKER
Hello:
Why was it moved to the neglected category? I only asked the question last night. Maybe I was not clear.
I am converting AJAX Toolkit Scripts to JQuery. One of the scripts that I am converting is the AJax Toolkit NumericUpDownExtender. The way my script is now, the NumericUpDownExtender is dynamic and reads values from a database. So what I want to do is use the JQuery Spinner instead of the AJAX Toolkit NumericUpDownExtender.
What I do not know how to do is get the values from a database and put them in the JQuery Spinner Code so that the Step Value and Spinner value are dynamic based on user input. Below is my JQuery Spinner Code
Why was it moved to the neglected category? I only asked the question last night. Maybe I was not clear.
I am converting AJAX Toolkit Scripts to JQuery. One of the scripts that I am converting is the AJax Toolkit NumericUpDownExtender. The way my script is now, the NumericUpDownExtender is dynamic and reads values from a database. So what I want to do is use the JQuery Spinner instead of the AJAX Toolkit NumericUpDownExtender.
What I do not know how to do is get the values from a database and put them in the JQuery Spinner Code so that the Step Value and Spinner value are dynamic based on user input. Below is my JQuery Spinner Code
<script>
$(function() {
var spinner = $( "#spinner" ).spinner();
$( "#spinner" ).spinner({
step: 5,
numberFormat: "n"
});
$( "#setvalue" ).click(function() {
spinner.spinner( "value", 15 );
});
});
</script>
Look at create or start event for Spinner.
http://api.jqueryui.com/spinner/
Perform, ajax call to server
Assign the returned result to set min and max limits
e.g.
$('#spinId').spinner('opti on', 'min', data.min);
$('#spinId').spinner('opti on', 'max', data.max);
http://api.jqueryui.com/spinner/
Perform, ajax call to server
Assign the returned result to set min and max limits
e.g.
$('#spinId').spinner('opti
$('#spinId').spinner('opti
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Awesome.Thank you
You are welcome - thanks for the points and good luck with your project.
You might need to post some more code.
Show us where you are trying to make the AJAX call
The code you have posted does not seem to return anything that would be useful to an AJAX call