|
-
Aug 2nd, 2011, 01:01 AM
#1
Thread Starter
Junior Member
[RESOLVED] VS2010 What controls should i use for a Web2.0 type data update.
Hi,
Below is what I would like to achieve, I just want to know what controls and technologies you would use to gain the desired effect.
Firstly, I want to read some rows of Data from a SQL datasource.
I want these rows to display on an ASP page. I do not care what control is used to display these rows.
Secondly, I want to be able to click on each of these rows to perform a data UPDATE/DELETE on the selected row.
Third, I want to use jQuery or something similar to make the selected row fade out. Preferablly all this would be done without a postback, but if it makes it easier, I can just use a postback.
To avoid postbacks, would I need to create a web service?
Ignoring postbacks, is it possible to either:
A. call a piece of behindcode in a jQuery script or
B. call a piece of jQuery after a postback.
I would think one of these two solutions would combine to give me the desired effect I am after.
-
Aug 2nd, 2011, 06:49 AM
#2
Re: VS2010 What controls should i use for a Web2.0 type data update.
Are you using Asp or Asp.net ?
Please mark you thread resolved using the Thread Tools as shown
-
Aug 2nd, 2011, 07:35 AM
#3
Thread Starter
Junior Member
Re: VS2010 What controls should i use for a Web2.0 type data update.
Sorry, im am using Asp.net
-
Aug 2nd, 2011, 07:53 AM
#4
Re: VS2010 What controls should i use for a Web2.0 type data update.
Can't you use repeater control to display the data ?
Please mark you thread resolved using the Thread Tools as shown
-
Aug 2nd, 2011, 05:17 PM
#5
Thread Starter
Junior Member
Re: VS2010 What controls should i use for a Web2.0 type data update.
I don't have much experience using the repeater control so pardon my ignorance. From what I gather on msdn, the advantage of using the repeater control is that it will get data and repeat it in the HTML side of things based on a template.
This sounds fine and would suit my needs. However, I am still not sure how I would call the jquery script (to fade out) with the SQL update (preferably without postback) I am only now starting to implement client side code so that may contribute to my lack of understanding.
-
Aug 3rd, 2011, 12:37 AM
#6
Re: VS2010 What controls should i use for a Web2.0 type data update.
 Originally Posted by davieeeee
I don't have much experience using the repeater control so pardon my ignorance. From what I gather on msdn, the advantage of using the repeater control is that it will get data and repeat it in the HTML side of things based on a template.
This sounds fine and would suit my needs. However, I am still not sure how I would call the jquery script (to fade out) with the SQL update (preferably without postback) I am only now starting to implement client side code so that may contribute to my lack of understanding.
You can place the control in Ajax Update Panel and handle the event to make the sliding effect.
Sample code
Code:
<script language="javascript" type="text/javascript">
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_initializeRequest(InitializeRequest);
prm.add_endRequest(EndRequest);
var postBackElement;
function InitializeRequest(sender, args)
{
//Start Your animation here
CloseError();
if (prm.get_isInAsyncPostBack())
args.set_cancel(true);
postBackElement = args.get_postBackElement();
if ((postBackElement.id == 'btnSave') || (postBackElement.id == 'ddlVehicleCode') || (postBackElement.id == 'ddlToCompany'))
{
$get('UpdateProgess2').style.display = 'block';
toggleControls(true);
}
}
function EndRequest(sender, args)
{
//End your animation here
if ((postBackElement.id == 'btnSave') || (postBackElement.id == 'ddlVehicleCode') || (postBackElement.id == 'ddlToCompany'))
$get('UpdateProgess2').style.display = 'none';
// Check to see if there's an error on this request.
if (args.get_error() != undefined)
{
// If there is, show the custom error.
$get('lblError').innerText = 'Sorry, An error occured while processing.';
// Let the framework know that the error is handled,
// so it doesn't throw the JavaScript alert.
args.set_errorHandled(true);
}
$get('btnSave').disabled=false;
toggleControls(false);
}
function CloseError() {
// Hide the error div.
$get('lblError').innerText = '';}
function toggleControls(value)
{
//Disable/enable the controls in the panel
$get('ddlToCompany').disabled=value;
$get('ddlFacility').disabled=value;
$get('ddlVehicleCode').disabled=value;
}
</script>
Please mark you thread resolved using the Thread Tools as shown
-
Aug 3rd, 2011, 06:39 PM
#7
Thread Starter
Junior Member
Re: VS2010 What controls should i use for a Web2.0 type data update.
danasegarane, thank you for your help and even supplying sample code. I really appriciate it.
-
Aug 4th, 2011, 01:45 AM
#8
Re: [RESOLVED] VS2010 What controls should i use for a Web2.0 type data update.
Nice sample Dana
-
Aug 4th, 2011, 08:11 AM
#9
Re: [RESOLVED] VS2010 What controls should i use for a Web2.0 type data update.
Thanks Gary
Please mark you thread resolved using the Thread Tools as shown
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|