Category GENERIC HANDLER

CasCading DropDownList using Generic Handler and JQuery in Asp.net

Category: ASP.NETGENERIC HANDLERJQUERY Comments: 2 comments

ometimes we need to do fill dropdownlist using JQuery and Generic Handler in Asp.net Explanation given below: Design Page: SELECT YOUR STATE Generic Handler: public void ProcessRequest(HttpContext context) { context.Response.ContentType = "application/json"; int id = Convert.ToInt32(context.Request["id"]); string sJSON = GetProduct(id); context.Response.Write(sJSON); } public string GetProduct(int id)Read More

Get Records by Generic Handler Using JQuery in Asp.net

Category: ASP.NETGENERIC HANDLERJQUERY Comments: No comments

HandlerUse.aspx------------------------------------------------------
Search User
User ID
Loading.
Id Name Price
Read More

Use of Post and Get Method in Jquery

Category: GENERIC HANDLERJQUERYWEB SERVICE Comments: No comments

Use of Post Method in Jquery to Send Data on Button Click $(document).ready(function(){ $('input[id$="Button Id"]').click(function(){ var Fname="Text Value"; // name is local variable you can use without declaring. var res=$.post('Path of Generic Handler or Webservise', { name: Fname}, function (result) { alert(result); }); rsp.errorRead More

Upload Image in folder using Fileupload Control and Handler in Asp.net using Jquery

Category: ASP.NETGENERIC HANDLERJQUERY Comments: No comments

Steps for Upload Image in folder using Fileupload Control in Asp.net using Jquery

1. Add script to Design Page Head

<script type=”text/javascript”>
function readURL(input) {
var id = input.id;
var path = input.value;
var file = path.split(“\\”);
var filename = file[file.length - 1];
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$(“#” + id).after(“<span><img src=’loading.gif’/></span>”);

$.post(‘Handler Path to send data’, { FileData: e.target.result, fileName: filename },
function (result) {
$(“#” + id).next().remove();
alert(result);
});
}
reader.readAsDataURL(input.files[0]);
}
}
</script>

//Use Loader image to show loading while uploading

//Loader Image : loading.gif

2. Add Control to Form

<input type=”file” id=”myfile1″ runat=”server” onchange=”readURL(this);” />

3. Add Generic Handler class file to your project

Click on Image to display big

Handler

Read More