|
see you first of all define this as
Dim cntrl = Page.LoadControl("../User_Control/cmbSubCatagory.ascx")
ok.
giving u the example to make u bit clear
This the main web page
<%@ Page Language="VB" Inherits="myPage" Src="2001012601.vb" %>
<asp:label id="soonToBeUserControl" runat="server">
Option Strict Off
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Public Class myPage : Inherits Page
Public soonToBeUserControl As Label
Public Sub Page_Load(Source As Object, E As EventArgs)
soonToBeUserControl.Text = "Test"
End Sub
End Class
this the user control
<%@ Control Inherits="myUserControl" src="2001012601uc.vb" %>
<asp:label runat="server" id="myLabel">
<asp:datagrid runat="server"
="" id="myDataGrid" font-size="x-small" headerstyle-font-bold="True" headerstyle-forecolor="White" headerstyle-backcolor="Brown" alternatingitemstyle-backcolor="Tan">
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Data
Imports System.Data.SqlClient
Public Class myUserControl : Inherits UserControl
Public myDataGrid As DataGrid
Public myLabel As Label
Public Property myProp As String
Get
Return myLabel.Text
End Get
Set
myLabel.Text = Value
End Set
End Property
Public Sub Page_Load(Source As Object, E As EventArgs)
Dim ds As New DataSet
Dim sda As SqlDataAdapter
sda = New SqlDataAdapter("SELECT CompanyName, ContactName, ContactTitle FROM Customers",_
"server=localhost;uid=sa;pwd=;database=Northwind;")
sda.Fill(ds, "Customers")
myDataGrid.DataSource = ds.Tables("Customers")
myDataGrid.DataBind()
End Sub
End Class
then the more things u need to add to the .aspx.vb are
Option Strict Off
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Public Class myPage : Inherits Page
Public soonToBeUserControl As Label
Public Sub Page_Load(Source As Object, E As EventArgs)
'Dynamically load the user control to the Page's Controls collection
Dim tempUserControl = Page.LoadControl("2001012601uc.ascx")
'Set the user control's myProp value
tempUserControl.myProp = "This property was set in Code Behind"
'Add the user control to the Label's Controls collection
soonToBeUserControl.Controls.Add(tempUserControl)
End Sub
End Class
now u can get easily i think
|
|
|
|
|
in the windows region code of the parent page add the code
<br />
Protected Withevents YourUserControlInstance as uc YourUserControlInstance<br />
'Example<br />
Protected Withevents ucTest1 as uc ucTest<br />
This way u can access it simply
hope this would help
Best Regards
3ala2
|
|
|
|
|
Hi friens
i want to remove control box from the web page.
how can i remove that?
please reply me.
Pathan
|
|
|
|
|
Hi Imran
Which control box are you talking about be more specific
|
|
|
|
|
a control box that is used to minimize,maximize and close on top-left of the form
Pathan
|
|
|
|
|
OK you mean to say Menu bar or address bar yes you can remove it but the problem is you cannot remove the address bar of current application as i know you cannot get object of current browser so you can do one thing
Develope one application which contain only button and msg Onclickbutton event write this code which will call the your other application which you have to open in the browser with no bar write this code in buuton event
SHDocVw.InternetExplorerClass objects = new InternetExplorerClass();
objects.Navigate("http://localhost:3934/TestForForums/Default.aspx", ref empty, ref empty, ref empty, ref empty);
objects.AddressBar = false;
objects.IWebBrowserApp_MenuBar = false;
objects.IWebBrowserApp_StatusBar = false;
objects.IWebBrowserApp_ToolBar = 0;
objects.Visible = true;
|
|
|
|
|
Hi,
I need help for creating Search Option for Combo Box. The search should be like based, Suppose if the user searches for "Basic" system should retrieve "Visual Basic", "basic", "Visual Basic .NET" etc.
Please help me out.
Thanks,
Libran
|
|
|
|
|
Hi.
Try this query string for searching
string str="select * from <tablename> where user like '%" & combo.text & "%'";
Pathan
|
|
|
|
|
Hi All
i have i javscript function in .js file ok now i want to call that javascipt function from my windows application which returns value
|
|
|
|
|
you can not call a javascript function from windows application.
regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
Why do u need that?
Best Regards
3ala2
|
|
|
|
|
Hi
Actually i am developing i testing tools in which i have read data from html page but the data is coming from javascript function so i can't read the data if i parse the html file .
so i have decided to use MShtml.ddl amd SCDocVw.dll so that by using IHTMLdocumentClass amd InternetBrowserclass to get data
but if you can tell me how to call the javascipt function then it will be easier fro me
Thanks
|
|
|
|
|
Hi, In my app i generated a tablerows dynamically through javascript,after the postback the dynamic rows are vanished.
what i have to do maintain dynamic rows(contain texboxes in each cell)?
After filling the textboxes(html textboxe,i want to pass all the values to the database,
How can i pass these textbox values to server?
Plz give me some idea regarding that?
Advanced Thanks
Srilakshmi.
|
|
|
|
|
srilu nagalla wrote: what i have to do maintain dynamic rows(contain texboxes in each cell)?
You have to recreate them on every postback.
srilu nagalla wrote: After filling the textboxes(html textboxe,i want to pass all the values to the database,
How can i pass these textbox values to server?
If the fields are inside the form that is posted to the server, their values are included in the data that is posted. You can use Request.Form to retrieve the values on the server.
---
b { font-weight: normal; }
|
|
|
|
|
Where are you calling the Javascript to create dynamic textboxes?
The script might not be running after the postback causing the textboxes to vanish.
I still cudnt figure out why are you creating textboxes with Javascript.
Please explain your scenario so that anyone here can help you out or provide a better solution to your problem.
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
_mubashir wrote: Where are you calling the Javascript to create dynamic textboxes?
When i enter in page it contains table heading and one row with textboxes,after i fill boxes and then press "Enter" button then next row will add
_mubashir wrote: I still cudnt figure out why are you creating textboxes with Javascript.
For execution faster i want to add rows dynamically,to remove burden on the server.
Is their any wrong in my view? which is the best one,server side rows creation,client side creation
Which is the faster one? and eaiser one?
|
|
|
|
|
i have 2 labels 2 text boxes 1 button which on click should save the details in my database where as i also have a dropdownlist which should show all the names and a gridview which should contain all the hyper;inks to the fields.this is to be done using oracle as a backend.
i have designed the form but i am unable to connect it to database as i don't have a knowledge of using oracle as backend.
so kindly plz help me.
ratish
|
|
|
|
|
There are a number of articles written on this...Use google first, try them out and if you stuck somewhere using the code then consult here.
The members here are considered to work themselves rather than they are provided with the spoon feed.
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
see i have created a code as i told u i am facing a problem in connectivity if u wan't i can send u the code.
|
|
|
|
|
plz post the exact problem that you are having to get connected to the oracle database.
regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
hi
using system.data.odbc;
thn create a ODBC connection string
and cofigure ODBC and DNS through Control Panel.
deepak
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
hi guys
I want to create folder with help of .NET. When user clicks on new folder from menu then new folder will be created on particular path.
Please help if any one knows..........
Thanks in advance
Regards,
DJ Rock
|
|
|
|
|
hi
hope tht'll helps u
<br />
<br />
string myfolder = ("d:\\abc" );<br />
<br />
System.IO.Directory.CreateDirectory(myfolder);<br />
<br />
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
hey deepak thanks a lot man
Regards,
DJ Rock
|
|
|
|
|
Hi,
i have the four tier application,the first tier in the presentatin ,second tier is the business entity ,third tire in the data access layer and the on the fourth tier the database.
i wnt to implement the business Entity through collections,the data acces layer fill the business entity and the business entity fill the presentation layer.tell me how can i code the business entity ??
|
|
|
|