User Profile

Collapse

Profile Sidebar

Collapse
Lucas
Lucas
Last Activity: Sep 17 '07, 09:20 PM
Joined: Aug 28 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Lucas
    replied to Troubles using javascript file as a webresource
    in .NET
    I found a solution to my problem. It is not exactly what i wanted but it's working. Instead of using the javascript file as an embedded resource, this aproach uses it as a linked resource. For whoeverneedings omethinglikethi s's sake here is the code to add javascript to a web user control as mentionated:

    Web control class code:

    Code:
    Partial Class WebUserControl
        Inherits System.Web.UI.UserControl
    ...
    See more | Go to post

    Leave a comment:


  • Lucas
    replied to Troubles using javascript file as a webresource
    in .NET
    Yes i do. And to lengthen my message to at least 20 characters this is my web user control client side code showing the runat="server" tag:

    Code:
    <%@ Control Language="VB" AutoEventWireup="false" CodeFile="WebUserControl.ascx.vb" Inherits="WebUserControl" %>
    <asp:TextBox ID="TextBox1" runat="server" Style="z-index: 100; left: 26px; position: absolute;
    ...
    See more | Go to post

    Leave a comment:


  • Lucas
    started a topic Troubles using javascript file as a webresource
    in .NET

    Troubles using javascript file as a webresource

    I have a web user control with a button on it and i want to hook a javascript function to this button.

    This is my web user control code:

    Code:
    <Assembly: WebResource("jstest.js", "text/javascript")> 
    Partial Class WebUserControl
        Inherits System.Web.UI.UserControl
    
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As    System.EventArgs) Handles Me.Load
    ...
    See more | Go to post

  • Expose the text of the textbox as a public property from your control class. It would be something like this:

    From your control class:

    Public ReadOnly Property strText() As String
    Get
    Return TextBox.Text
    End Get
    End Property

    From your aspx:

    Dim x as string = UserControlName .strText()

    Hope this solves your problem..
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...