.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Can i override the sqlexcption object into ajax OnError function?

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :ASP.Net
Hi Dude, I am little stranger to web service. i do not know how can i implement your given functionality? i will show my webservice and web method. Please let me know how can i override the sqlexption error object to ajax error object? Please help me as soon as possible.. <WebMethod()> _       Public Function AddDetailPageData(ByVal strTableQuery As String, ByVal strFieldName As String, ByVal strFieldData As String, ByVal strWherCond As String)        Dim intRecCount As Integer = 0        Try            Dim param() As SqlParameter = New SqlParameter() _                                {New SqlParameter("@strtableQuery", SqlDbType.NVarChar, 50), _                                New SqlParameter("@strFieldList", SqlDbType.NVarChar, 4000), _                           

View Complete Post

More Related Resource Links

How to send parameters to the AJAX callback function


I need to send som parameters to the callback function of my AJAX call, how can i do that:



function DoSomething(id, textbox1)
  AjaxHandler.FindSomethingInDB(id, Callback);

function Callback(result, eventArgs)
  // Here i need to know the value of textbox1 from the function "DoSomething"


How to connect the OledbCommand object with another Member Function

protected void GridViewTest_RowDeleting(object sender, GridViewDeleteEventArgs e)
       int deleteKey = Int32.Parse(GridViewTest.DataKeys[e.RowIndex].Value.ToString());
       OleDbCommand deleteCommand = new OleDbCommand();
       deleteCommand.CommandType = CommandType.StoredProcedure();
           deleteCommand.Parameters.AddWithValue("@empid", deleteKey);
 private DataTable  Connection1(string Storedprocedure)
       using (OleDbConnection MyConnection = new OleDbConnection(ConfigurationManager.AppSettings[0].ToString()))
           OleDbDataAdapter MyAdapter = new OleDbDataAdapter(Storedprocedure, MyConnection);
           DataTable MyTable = new DataTable();
           return MyTable;

Hello Members,

           I need one help..I Don't know how to connect the command object with
another Member function...
I tried something in the above code...But i got error...Please put me in right direction...


Get xhr object in vb.net when error occured in ajax call using JQuery.

Hi Dude,   I have a big problem in Jquery ajax call. I am calling the web service whenever click the update button. I have a separate web service class, in which consist of few methods. When I calling the web service method, I have made the error handling and log the error information in db after that I have to override the "ex" that means error object to XMLHttpRequest. Is it possible to assign the sqlexception to ajax object (xhr) in vb.net? Please help me its much more useful for me.   Thank in advance.

Simple return value from WebMethod from Ajax function using JQuery


I have an Ajax function called from JQuery that goes to a webservice to return a value.  I need a SIMPLE example on how I can do this.  I've been going nuts with serializing and every other aspect of this topic. 

I need to return either an ArrayList with ONE string field or a DataTable of some kind.  Either way, I'm populating it into a DropDownList.

I'm willing to consider alternatives to this idea. (Background info - I get a value from a textbox and I need to run it through a DB to get an associated value or set of values).  I'm being really general so that someone can show a simple example.  Thanks.

Updation in gridview using Ajax XmlHttp Object does't work



I have many divs in 1 page and each div consists of a gridview, the gridview is loaded by making AJax calls.

On load of the page, all the grid load data properly.

But now when i update any row in either of the grids, and make a call to the javascript that loads the grid in the page, it doesn't work rightly.

Any advices. Am i doing something wrong.

Wat are the options to update/refresh the grid.


AJAX HTML Editor insertHTML() function



I have editor and I want to add a HTML to it with a button from a toolbar. I have been searching through this forum and came up with this, but it does not work:

Here is the code on the .aspx page:

<script type="text/javascript">
        function addHTML() {
            var editor = $find("editor");
            var editPanel = editor.get_editPanel();
            var designPanel = editPanel.get_activePanel();

    <customEditors:MyHtmlEditor ID="editor" runat="server"></customEditors:MyHtmlEditor>

And this is a class for my custom editor:

Public Class MyHtmlEditor
        Inherits Editor

        Protected Overrides Sub FillTopToolbar()

            Dim newBtn As New AjaxControlToolkit.HTMLEditor.ToolbarButton.MethodButton
            newBtn.Attributes.Add("onmouseover", "addHTML();")

How to use ajax for recursive call of a function in asp classic


I have a asp page with parent and child relation  task when i click on + sign the task with the parent id of the first should open. it may go up to nth level


1 >2







so to go to 8 we have 1>2>5>7>8

so first i have to click on 1 which will open its child then i have to select 2 which opens its child.

If i am doing it on same page recursively it hits performance.

as it is a asp page and each time it is hiting the server so i have to use ajax and build the page out side and append this to my parent page 

can any one help me in this regards,


Please Mark the answers and give points it will help users Thanks & Regards, Kamal Agarwala

How to call a ajax recursive function


I have a asp page with parent and child relation  task when i click on + sign the task with the parent id of the first should open. it may go up to nth level


1 >2


Can't override a default value of a text box function

I have a text box that calculates the default value based on the values of other fields. I need the ability to override this default value and enter in a static value. The problem is when I enter in my static value and save the form, close it and reopen the form the calculated value shows instead of the static value I entered.

Any idea what might be causing this?

Calling a javascript function from server side, using AJAX timer



I am developing a ASP.NET ajax application.
I am using a timer:

<asp:Timer ID="Timer1" runat="server" OnTick="Timer_Tick" Interval="5000" />      

The only thing I want to do is to call a javascript function on every tick of the timer:

 protected void Timer_Tick(object sender, EventArgs e)
            ClientScript.RegisterClientScriptBlock(this.GetType(), "blink", "<script>blinkit('2');</script>");

This doesn't work.
The javascript function is being called only if I put the 'RegisterClientScriptBlock' in the Page_Load.

How can I call the javascript every couple of seconds?

Thank you

Getting Object required, but page function still works..


Want to clear the yellow exclamation point in the browser.. it builds fine, it works fine, but if you happen to look down in the bottom or your browser is setup to display these errors, you will get  an error message that reads

Object Required
Code: 0
Line: 13

When i view the source of the page here is what i have for those lines, then below that is how its written in the aspx page, what did i miss or do wrong?


<script type="text/javascript">
        function showsearchMenu(num) {
            for (var i = 0; i <= 4; i = i + 1) {
                if (i != num)
                    document.getElementById('searchNav' + i).style.display = "none";  --------------->>> This is line 13
                    document.getElementById('searchNav' + i).style.display = "block";
        function goSearchOption(theoption) {
            for (var i = 1; i <= 3; i = i + 1) {
                if (i != theoption)
                    document.getElementById('searchOption' + i).style.display = "none";
                    document.getElementById('searchOption' + i).style.display = "block";

how to make VS Intellisense show complex object's properties for result of Ajax call?



I've create a WCF webservice and created a proxy to the service using ScriptManager.

I can see the created a proxy class, and intellisense pops up the methods of the webservice (great!!). But, I can't see the properties of the method params, return types.

The webservice method:

searchResponse DBSearch.Search(searchRequest)

have comlex types as a parameter (searchRequest) and a return type (searchResponse).

Intellisense does recognize these types, but I can not see the properties (javacript does);


var _searchRequest = new DBSearch.SearchRequest; (intellisense knows type SearchRequest)

_searchRequest.query = "liver lacerations"; (intellisense doesn't know it's property 'query')

_searchRequest.searchOptions = "modality=mri";

Obviously, with javascript, var _searchRequest is not typed, but is there a way to hint intellisense into the properties of the class?



How override inheritance from Default.Master page? How override default.master function acting on ju


 There is this one function that i can't remove from the Default.master page because other forms in the project use it and are happy to inherit from it. But in one form it messes up the layout as it injects a line below every text box to tell the user how many characters he's typed and how near the 1000 char limit he is. For this form we dont' need or want that on every asp:textbox. How can i keep the rest of the inheritance from Default.Master but exclude or avoid or override this function acting on textbox controls in this one form?

Here's the function as given in the default.master page, fyi:


function() {var countdown = {function() {//alert($(countdown.obj).attr('id'));

countdown.remaining = countdown.max - $(countdown.obj).val().length; 

$(countdown.obj).val($(countdown.obj).val().substring(0, countdown.max));

countdown.remaining = 0;


why Finalize() in Object is override not virtual?


Finalize() is override, why it's not virtual? what's difference between virtual and override for method in base class? Thanks

public class Object
    public Object();
    public virtual bool Equals(object obj);
    public static bool Equals(object objA, object objB);
    protected override void Finalize();
    public virtual int GetHashCode();
    public extern Type GetType();
    protected extern object MemberwiseClone();
    public static bool ReferenceEquals(object objA, object objB);
    public virtual string ToString();

[object Object] being appended to Ajax get request?


Hello everyone,

I have a strange problem with MVC2 appending [object Object] to an anchor tag...

<a href="/Projects" id="get_projects">Get Projects</a>

If I set up a click handler for this using jQuery to make a GET call to my Projects controller, Index action, when I inspect the request in Firebug, the Url is now: /%5Bobject%20Object%5D instead of /Projects

However, if I use the built-in Ajax.ActionLink, everything works fine. I don't want a bunch of obtrusive JavaScript. Where is the [object Object] value coming from, and why is MVC2 altering my request? I should be able to issue a simple GET request to a Controller without using a bunch of obtrusive JavaScript generated by Microsoft.


sys.extended.UI.PositioningMode.Absolute is null or not an object ,callout ajax control



I'm using  callout ajax control but i'm getting an error "sys.extended.UI.PositioningMode.Absolute"

Any ideas??

JQuery function is not calling when JQuery Ajax method succeed


Hi I am doing a small application in asp.net using JQuery
<script language="javascript" type="text/javascript">
        $(document).ready(function() {
            var imgPoll = new Image();
            imgPoll.src = 'images/red-bar.png';
            if ($("#divVoted").length > 0) //Already
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend