Go Back   Velocity Reviews > General Computer Discussion > Software
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
Old 02-07-2008, 03:30 AM   #1
Default How To Access HTML elements in code behind???


Hi,

I'm trying to access HTMl elements in code behind in .net 2. but couldnt find a way yet.

Could any one please help me to acces an iframe in code behind.

in my case i have seperated code behinds from the projects and placed in different project.
i'm trying to add aspx pages into sharepoint.

my aspx files is
<%@ Page Language="C#" MasterPageFile="_catalogs/masterpage/TestF_Sitespan2.master" Inherits="MyTest.Reports" Title="Test" %>

this doesnt has a CodeFile attribute set.

in my code behind
i have

public partial class Reports : stem.Web.SessionState.IRequiresSessionState
{
protected HtmlForm Form1;
protected TextBox TextBox1;
protected System.Web.UI.HtmlControls.HtmlGenericControl rptFrame;


}
and

public partial class Reports : System.Web.UI.Page
{
string FRAME_SRC = "http://www.yahoo.com";
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
}
protected void Page_Load(object sender, EventArgs e)
{

}
protected void OnChanged(object sender, EventArgs e)
{
TextBox1.Text = "AAAAAA";
HtmlControl rptFrame = (HtmlControl)this.Form1.FindControl("rptFrame");
rptFrame.Attributes["src"] = "http://www.google.com";// String.Format("myIinfoPage.aspx?id={0}", selection);

}
}

Here I can access an asp.net web control (Textbox)
but couldnt access the iframe.
even when i debug the code i noticed the form too had a null value in the code .

Any idea about accessing form or html elements from the code behind.

Could any one please let me know how to access this


Thanks
Ned


nedums_b
nedums_b is offline   Reply With Quote
Old 02-07-2008, 07:15 PM   #2
ProgTalk
Junior Member
 
Join Date: Dec 2007
Posts: 29
Default
Did you make sure all things are server controls?


ProgTalk
ProgTalk is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
I cant access the MCP site T3M4N MCTS 1 03-18-2008 06:21 PM
Pix 515E Access List issue ally0000 Hardware 3 02-15-2008 01:34 PM
Pix 515E Access ist issue ally0000 Hardware 0 01-12-2008 10:09 AM
Cannot access one URL Elke General Help Related Topics 1 12-02-2006 11:36 AM
Cisco 2811 VPN Access manu Hardware 0 09-11-2006 11:58 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46