Search Results

Search found 6 results on 1 pages for 'harrije'.

Page 1/1 | 1 

  • ASP.NET how to use __doPostBack from Custom JavaScript with Master/Content Pages

    - by harrije
    In a simple aspx page I can have a custom JavaScript function postback as described in http://www.xefteri.com/articles/show.cfm?id=18 The simple page uses a linkbutton: <asp:LinkButton id="CreateFile" runat="server" onclick="CreateFile_Click" /> with code behind that has the VB subroutine: Sub CreateFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) and a Javascript custom function that does: __doPostBack('CreateFile',''); When I move the code to a content page with a corresponding master page the simple example no longer works. I'm aware that server control IDs are changed in the generated HTML when a master page is involved, and I'm using the correct IDs in the Javascript. As an example, for the LinkButton ID I use '<%=CreateFile.ClientID%' for the Javascript in the generated HTML. Never the less, I still can't figure out how to get postbacks from the Javascript when master pages are involved. More accurately, with a master page in the mix the code won't even compile but results in: 'CreateFile_Click' is not a member of 'ASP.testmaster_aspx' If I remove onclick="CreateFile_Click" from the LinkButton markup it compiles but does not work. Similary if onclick is removed from the simpler version without a master page it does not work either, as expected. Any input on how to get postback from a custom Javascript function when using master pages would be much appreciated.

    Read the article

  • Classic ASP vs. ASP.NET encryption options

    - by harrije
    I'm working on a web site where the new pages are ASP.NET and the legacy pages are Classic ASP. Being new to development in the Windows env, I've been studying the latest technology, i.e. .NET and I become like a deer in headlights when ever legacy issues come up regarding COM objects. Security on the website is an abomination, but I've easily encrypted the connectionStrings in the web.config file per http://www.4guysfromrolla.com/articles/021506-1.aspx based on DPAPI machine mode. I understand this approach is not the most secure, but it's better than nothing which is what it was for the ASP.NET pages. Now, I question how to do similar encryption for the connection strings used by the Classic ASP pages. A complicating factor is that the web sited is hosted where I do not have admin permissions or even command line access, just FTP. Moreover I want to avoid managing the key. My research has found: DPAPI with COM interop. Seems like this should already be available, but the only thing I could find discussing this is CyptoUtility (see http://msdn.microsoft.com/en-us/magazine/cc163884.aspx) which is not installed on the hosting server. There are plenty of other third party COM objects, e.g. Crypto from Dalun Software http://www.dalun.com, but these aren't on the hosted server either, and they look to me to require you to do some kind of key management. There is CAPICOM on the hosted server, but M$ has deprecated it and many report it is not the easiest to use. It is not clear to me whether I can avoid key management with CAPICOM similar to using DPAPI for ASP.NET. If anyone happens to know, please clue me in. I could write an web service in ASP.NET and have the classic ASP pages use it to get the decrypted connection strings and then store those in an application variable. I would not need to use SSL since I could use localhost and nothing would be sent over the internet. In the simpliest form I could implement what someone termed a poor man's version based on a simple XML stream, however, I really was looking to avoid any development since I find it hard to believe there is not a simple solution for Classic ASP like there is for ASP.NET. Maybe I'm missing some options... Recommendations are requested...

    Read the article

  • ASP.NET control in one content area needs to reference a control in another content area

    - by harrije
    I have a master page that divides the main content into two areas. There are two asp:ContentPlaceHolder controls in the body section of the master page with IDs cphMain and cphSideBar respectively. One of the corresponding content pages has a control in cphMain that needs to refer to a control in cphSideBar. Specifically, a SqlDataSource in cphMain references a TextBox in cphSideBar to use as a parameter in the select command. When the content page loads the following run-time error occurs: Could not find control 'TextBox1' in ControlParameter 'date_con'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Could not find control 'TextBox1' in ControlParameter 'date_con'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [InvalidOperationException: Could not find control 'TextBox1' in ControlParameter 'date_con'.] System.Web.UI.WebControls.ControlParameter.Evaluate(HttpContext context, Control control) +1753150 System.Web.UI.WebControls.Parameter.UpdateValue(HttpContext context, Control control) +47 System.Web.UI.WebControls.ParameterCollection.UpdateValues(HttpContext context, Control control) +114 System.Web.UI.WebControls.SqlDataSource.LoadCompleteEventHandler(Object sender, EventArgs e) +43 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Page.OnLoadComplete(EventArgs e) +8698566 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +735 I kinda know what the problem is... ASP.NET does not like the fact that the SqlDataSource and TextBox are in different asp:Content controls within the content page. As a workaround, I have another TextBox in cphMain with the SqlDataSource which has Visible=False. Then in the Page_Load() event handler the contents of the TextBox in cphSideBar is copied into the contents of the non-visible TextBox in cphMain. I get the results I want with the work around I've come up with, but it seems like such a hack. I was wondering if there is a better solution I'm missing. Please advise.

    Read the article

  • ASP.NET TextBox verses input type="text" behavior

    - by harrije
    I notice with ASP.NET if the server side control TextBox is used with out autopostback it will not submit (or postback) the form when typed text ends with enter, which is different from the behavior for plain old HTML pages. Fine, I can set autopostback to get the behavior I want after the enter key. However, autopostback will also cause submit (or postback) when the typed text does not end with enter but focus has changed (i.e. with tab or mouse click), which again is different from plain old HTML pages. How can I get an ASP.NET page to behave the same as a plain old HTML page with respect to text input regardless of whether enter key or change of focus occurs?

    Read the article

  • ASP.NET with VS 2008 How to Run Root "/" with Local Web Server

    - by harrije
    I want to use the built-in web server for VS 2008 and have it run my web-site project as the top level root "/". Instructions for VS 2005 can be found at: http://weblogs.asp.net/scottgu/archive/2006/12/19/tip-trick-how-to-run-a-root-site-with-the-local-web-server-using-vs-2005-sp1.aspx My problem is with step 3 of the instructions. When the the web-site project node is selected, right click never gives me an option to select a property-grid like that shown under step 3. Nor could I find another way in the menu or tool bar to get the property-grid. I don't know if the UI difference I'm seeing has to do with me using VS 2008 and the instructions are for VS 2005 or what? How do I get the web-site property-grid for VS 2008, or is there an alternative way to get the root setup I want?

    Read the article

  • ASP.NET: How to get same validators control to be both client-side and server-side

    - by harrije
    Hello, For the ASP.NET validator controls, I want to use both client-side validation for the user experience and server-side validation to guard against hackers. ASP.NET documentation leads me to believe that if EnableClientScript="True" then there will be no server-side validation if client-side validation is possible for the user agent. To get server-side validation, the documentation says use EnableClientScript="False", which bypasses client-side validation altogether. Am I misunderstanding how the validator controls work? I ask because it seems obvious that many developers would want both client and server side validation together, and I find it hard to believe both together is not possible with one of the standard validation controls. If I am understanding the ASP.NET documentation correctly, then I can find only two options: Use two validator controls exactly the same except for their ID and EnableClientScript properties. Obviously ugly for maintaining two controls almost the same. Write some code behind to check if postback then invoke the Validate method on the validator group. Why write code behind if there a way to be automatic from the control? Is there a way to do so using a single validator control with no code behind? Thanks in advance for your input.

    Read the article

1