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


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

How to restrict to call Web Methods

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :ASP.Net
 
 Scenario is, I have a tab container inside which I placed 5 tabs and each tab having 4 Cascaded dropDown. Now for changing the tab page everytime refreshed and calling all 5 parent control dropwdown to fill. But can I prevent it in that manner so that for changing the tab only that parent webmethods will be called to populate. In page load itself it will call only the active tab parent Cascading dropdown web method.


View Complete Post


More Related Resource Links

Using jQuery to directly call ASP.NET AJAX page methods

  
Here I am looking to explain how to call page methods using jQuery. Using jQuery to directly call ASP.NET AJAX page methods

Can not call two different pagemethods with two service methods??

  

I am using an AJAX dropdownlist control with two dropdownlist.  Instead of using a webservice to populate the data, I used the pagemethod to populate.  My problem is the second droplist won't populate.  I get a server error, 500 in the droplist.  The first droplist populates fine.

BUT here's the real kicker.  If I reverse the order of the public static function such that GetHelloList2 comes BEFORE GetHelloList1 in the code, then the GetHelloList2 works ...... it just seems like it is only firing one pagemethod event and allowign only one.


Here's my code:

ASPX

<asp:DropDownList ID="DropDownList1"
  runat="server" Width="285px" />
<br />Second droplist<asp:DropDownList ID="DropDownList2"
  runat="server" Width="285px" />
<br />


<cc1:CascadingDropDown ID="CascadingDropDown1"
  runat="server" Category="Hello3"
  TargetControlID="DropDownList1" ServiceMethod="GetHelloListPageMethod"
  LoadingText="Please wait" PromptText="Select a model">
</cc1:CascadingDropDown>

             <c

Call DLL Methods from outside the project / Load Dynamic WPF in aspx

  

Dear All Experts,

for my project, i created a solution with a one aspx page and all of other components are Dynamic load WebUserControls ascx, each user control and related functions are a separate webapplication project.

now i need to use WPF with my project, i dont know how to load the ".xbap" file Dynamically in my page,

also when i tried to use it as iframe, i face the error "System.Security.SecurityException: That assembly does not allow partially trusted callers" which means that i cannot call or use any of my DLL's methods from outside the project invironment (please note that i am not using strong names anywhere), i put [assembly: AllowPartiallyTrustedCallers]  attribute in AssemblyInfo.cs but also i cannot call required functions.

now the questions is:

1. can i associate with WPF (*.xdap) files and load it the same as dynamics user controls?

2. how to call and let my functions work outside the project invironment.

thanks.


Call DLL Methods from outside the project / Load Dynamic WPF in aspx

  

Dear All Experts,

for my project, i created a solution with a one aspx page and all of other components are Dynamic load WebUserControls ascx, each user control and related functions are a separate webapplication project.

now i need to use WPF with my project, i dont know how to load the ".xbap" file Dynamically in my page,

also when i tried to use it as iframe, i face the error "System.Security.SecurityException: That assembly does not allow partially trusted callers" which means that i cannot call or use any of my DLL's methods from outside the project invironment (please note that i am not using strong names anywhere), i put [assembly: AllowPartiallyTrustedCallers]  attribute in AssemblyInfo.cs but also i cannot call required functions.

now the questions is:

1. can i associate with WPF (*.xdap) files and load it the same as dynamics user controls?

2. how to call and let my functions work outside the project invironment.

thanks.


How to call page methods from a Master page ?

  

Hi,

I have written web methods in code behind and I'm able to call them using PageMethods.(method name) in an ordinary aspx page.

If I'm trying to call the webmethods in a master page using PageMethods.(method name), it is throwing a jscript error pagemethods

is undefined.

My code is like this:

 

   [System.Web.Services.WebMethod] 
   
    public static string[] GetTimes()
    {
        dt1 = DateTime.Now;
        string[] a = { };
        a[0] = dt1.ToUniversalTime().Subtract(new TimeSpan(5, 0, 0)).ToString("HH:mm");
        a[1] = dt1.ToUniversalTime().ToString("HH:mm");
        a[2] = dt1.ToUniversalTime().AddHours(0d).ToString("HH:mm");
        a[3] = dt1.ToUniversalTime().AddHours(8d).ToString("HH:mm");
        return a;
    }


<script language="javascript">

  function UpdateNYCTime() {


      PageMethods.GetTimes(times, OnSucceeded);

 }
 
 function OnSucceeded(result, userContext, methodName) {
   $get('spanNYC').innerHTML = result[0].toString(); 
 }
 




</script>


 

 

Any Suggestions ? If I cannot call page methods from master page page, is there any another way of calling them ?

Thanks,

Sailaja

 

Error: Cannot call methods on int (Microsoft SQL server, error: 258

  

I have written this SQL query in query designer in Report Builder

When I run it I appear to be getting the following message:

Cannot call methods on int (Microsoft SQL server, error: 258). Does anyone know why I am getting this. In theory this query should work.

SELECT

AccountsContacts.ContactID AS [AccountsContacts ContactID]

,AccountsContacts.Name

,AccountsContacts.Telephone

,AccountsContacts.Mobile

,AccountsContacts.Fax

,AccountsContacts.Email

,AccountsContacts.JobTitle

,AccountsContacts.Department

,AccountsContacts.AdditionalInfo

,Enquiries.ContactID AS [Enquiries ContactID]

,Enquiries.EnquiryID

FROM

AccountsContacts

inner JOIN Enquiries ON Enquiries.ContactID = AccountsContacts.ContactID

WHERE

Enquiries.EnquiryID = @Enquiries.EnquiryID


how to call methods in jar files in asp.net?

  

In my project i have a requirement to use a jar file in an ASP.net website. The jar file contains few methods with input and return parameters.

Is there any way to call the methods inside the jar file from .net without converting it to dll? Is there any easy way to create a connecter or wrapper between java and dot net?

Thanx in advance,

Arun


ASP.NET MVC: Using NonActionAttribute to restrict access to public methods of controller

  
 

Public non-action methods in ASP.NET MVC controllers are source of problems because they can be called by user when not handled carefully. Same time you may need public methods on controllers for some other reasons (some UI framework, testability problems, things you cannot change etc). In this posting I will show you how to handle controller methods properly.

Calling controller methods

Public methods of controller are called controller actions and these actions are mapped to URL-s using routes. Take a look at the following code.


public Acti

The Decorator Pattern & Extension Methods

  
The decorator pattern provides a formal way to add new functionality to an existing type, without sub-classing. First question: What is wrong with classical inheritance? In and of itself, nothing is wrong with the good old Is-A relationship. It is very common to derive a new class from an existing base class in order to override a few virtual members, and add a pinch of new functionality.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side

The Decorator Pattern & Extension Methods

  
Numerous design patterns exist in the software world today, and ultimately nothing is preventing you from making your own (if people buy into it or not is another question). Furthermore, there is no 'master list' of patterns that all developers agree upon. While this is true, if you pick up any book on the subject, you will find a set of very common patterns most programmers agree are very useful. Many of these patterns were first formalized in the seminal book on the subject, Design Patterns: Elements of Reusable Object-Oriented Software (aka, the Gang of Four [GOF] book; not to be confused with the UK punk band of the same name).

How to call an .exe file in .net

  
Sometimes a developer has to call an EXE from another EXE. While calling EXE there can be a requirement to pass parameter.

Xml File Methods and Properties

  
Method and Properties of XmlTextWriter class:
The XmlWriter class is a base class that outputs an XML data structure. It has methods to sequentially write XML elements in a proper hierarchy to create an XML file or other types of output streams. The System.Xml namespace provides support for the XmlWriter. It must be imported to the ASP.NET page with the directive

<%@ Import Namespace="System.Xml" %>

The XmlTextWriter

XmlWriter is an abstract class that is implemented as an extended XMLTextWriter class. The XmlTextWriter writes a sequence of XML nodes one element at a time. Output can be written to an XML file, although other streams of output data can be produced. It can create a new file or overwrite an existing file. Its non-cached writing techniques provides very fast generation of an output stream.

Page Methods and Yahoo UI

  

Hello people,
I'm constructing an application with Page Methods and YAHOO UI.
I'm Not using Update Panels because Page Methods are faster than Update Panel.

You can post your experiences with this feature of ASP.NET Extensions and vantages of using this type of architecture.

Thanks a lot.

Flávio Malaquias
Asp.Net Senior Developer


Multiple web methods in one transaction

  

Hi everyone

Sorry I am kinda new in web services, so it may sound a bit newbish question.

We have a web service that comunicates with the database and exposes web methods that enables the application to access the database. Each method does only one operation (Insert, Update or Delete). What I need to do is create a transaction that will be consisted of multiple calls to the database, meaning multiple calls of more then one web methods. Can I do that? (I read that if the web method does not throw exception - or ContextUtil.SetAbort() is not called - the transaction will be commited automatically when the web method finishes executing, which I don't want to happen because I want to call another web method in the same transaction, and then manually commit the transaction)

Thank you in advance.


Restrict Hyperlink

  

Hello All Experts,

I have made one matrix report, in which i have taken one column group named as "Branch".
It will display dynamically all the branches. Now in that column group i have added two sub column
as "PO", "SO". In column "PO" i have given link of anther report with the paramtere also.

Now there is a hyperlink in PO column which is display for all the branches, i want that the hyperlink should be there for only branch name "AHD", for other branches there should not be any hyperlink to go another report.

Is this possible? if yes then how can we do this?

Regards,
AKM


Categories: 
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