Search

You searched for the word(s): userid:762892

Matching Posts

  • Javascript and inline c#

    I need to call a c# method from javascript and I am having problems with the syntax. Appraiser.Templates is an enum. I am refering to the enum to get the name of the page. public enum Templates { StaffTemplate = 1, SupervisoryTemplate = 2 } This code works: < script language ="javascript" type ="text/javascript"> function openWinNew() { var ddlTemplatesIndex = document.getElementById( 'ddlTemplates' ).options[document.getElementById( 'ddlTemplates' ).selectedIndex
  • Re: Javascript and inline c#

    [quote user="srinivaskotra"] Hi, you have to change this code window.open( 'Templates/<%=System.Enum.GetName(typeof(Appraiser.Templates), %>ddlTemplatesIndex.value<%=)%> .aspx 'newtemplate' , '' , '' ); to window.open( 'Templates/'+ddlTemplatesIndex.value+'.aspx 'newtemplate' , '' , '' ); Thanks :) [/quote] Thanks srinivaskotra. That will not give me the name of the page from the enum but the index of the ddlTemplatesIndex
  • Re: Javascript and inline c#

    Thanks for the reply agr001. The System.Enum.GetName(typeof(Appraiser.Templates) in the Page_Load is not going to compile. I want to have the ddlTemplatesIndex.value from the JS as a parameter to the GetName method.
  • Re: Javascript and inline c#

    Accessing the page name from the enum works fine on my other code pages - the issue is trying to access it from JS. It is really not an enum problem but my lack of knowledge in concatinating this string to access both client and server code. window.open( 'Templates/<%=System.Enum.GetName(typeof(Appraiser.Templates), 1)%> .aspx 'newtemplate' , '' , '' ); The above code works. The problem is the syntax for replacing the 1 in the above code with the dropdownlist value
  • Re: Javascript and inline c#

    Yes, I can get the value from the code behind page. That is no problem. The problem is passing the dropdownlist value(javascript) as a parameter to the method in the c# code. The server method is Enum .GetName( typeof ( PrintTemplates ), [DROPDOWNLIST VALUE HERE]); The method is not complete because I broke it as noted below. I need to place the dropdownlist value as the parameter in the method as noted. window.open( 'Templates/) Server(<%=System.Enum.GetName(typeof(Appraiser.Templates),%>
  • Re: Javascript and inline c#

    [quote user="agr001"] if ddlTemplates is an asp.net serverside dropdown then use var ddl = document.getElementById('<% =ddlTemplates.ClientID %>'); Have a look at the browser source code to see why i keep mentioning the clientID. asp.net assigns these id's to the asp.net controls [/quote] Yes I understand and I can get that value just fine.
  • Re: Javascript and inline c#

    [quote user="jamezw"] You could write some server side code to render the enumeration as a JavaScript array like so: view plain copy to clipboard print ? protected void Page_PreRender( object sender, EventArgs e) { ClientScriptManager clientScript = Page.ClientScript; StringBuilder arrayValue = new StringBuilder(); Appraiser.Templates[] enumValues = Enum.GetValues( typeof (Appraiser.Templates)).Cast<Appraiser.Templates>().ToArray(); for ( int i = 0; i < enumValues.Length; i++)
  • Re: TinyMCE / Ajax Postback Problem

    I am trying to use steho706's code and it works for the first callback but if I save the page again I get a permission denied error in the tiny_mce js. Is there a workaround for this error?
  • Re: Set textbox text on aspx from ascx

    I set the notifier event to static and now the notifier is not null. The template_notifier method gets called multiple times almost like a postback for one button click so I'm not sure why that is happening.
    Posted to Web Forms (Forum) by forwheeler4 on 4/15/2009
  • Re: Set textbox text on aspx from ascx

    Thanks for the code. My notifier is always null on the user control. I am using a base class for my aspx page so I can use one code page for 2 pages. To declare the event handler on the base page, I needed a reference to the user control. I tried your ucMenu.notifier += new DelPassText(template_notifier) and I couldn't get a reference to the notifier. I used a reference to the Menu class instead like Menu menu = new Menu(); menu.notifier += new DelPassText(template_notifier) I don't think
    Posted to Web Forms (Forum) by forwheeler4 on 4/15/2009
Page 1 of 2 (18 items) 1 2 Next >