|
r u using the message board which is for another project?
you may change the namespace " Message " to the name space whis is for ur real project.
|
|
|
|
|
In asp.net, there is no MESSAGEBOX like windows application. though using javascript, you can send a message to the user example below
Modify your body tag like below
<body onload="alert('this is a test')">
HC
Best Regards,
Haissam Abdul Malak
My Blog
|
|
|
|
|
You need to use a clientside JavaScript (alert ) to show messageboxes.
|
|
|
|
|
Thanks everyone,
I've managed to make it work. But I now found a new problem I have to put Smallimages in front of RadioButton. How could I go about this?
Thanks
|
|
|
|
|
hai friends,
How to access the value of the Dynamically created control in asp.net (c#)?
suppose i create
void page_load()
{
TextBox t1=new TextBox();
form1.Controls.Add(t1);
}
Now i want to insert the value of the textbox in the database,but ID of the TextBox not known.
void insert_click(Object o,Sender e)
{
String s1=insert into table4 values(here i want to access the ID of the TextBox);
//Sql Connections.........
}
plz,Reply if u have known.Thank u Friends.
|
|
|
|
|
Hi,
When you create the control i.e. the textbox control, assign a value to the 'id' property of the textbox.
like...
Textbox t1=new TextBox()
t1.id="txt...."
form1.controls.add(t1)
later in your code you can access the textbox using this id.
Rate this message
Gautham
|
|
|
|
|
hai Gautham sir,
i already tried like that,
TextBox tt=new TextBox();
tt.ID="TextBox1";
but it gives compiletime error that "No such TextBox1 Control available" (that error locates the-- insert_click())
void insert_click()
{
String str="insert into table4 values('"+TextBox1.Text+"')";
SqlConnection..........
}
bcz only in the runtime the ID 'TextBox1' assigns to the dynamic control(TextBox) then how we can specify the name during Compilation.
try like that surely u got the error,plz help me sir.
-- modified at 4:32 Tuesday 6th March, 2007
|
|
|
|
|
Make sure that the textbox which you created is not private to any event. It should be protected or public so its accessible to all events of the aspx page
Gautham
|
|
|
|
|
sir,
i made the page_load as public,then the results shown below.
public partial class Default2 : System.Web.UI.Page
{
public void Page_Load(object sender, EventArgs e)
{
TextBox t1 = new TextBox();
t1.ID = "TextBox1";
form1.Controls.Add(t1);
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Server=localhost;uid='sa';pwd='sa';DataBase=master");
SqlCommand com=new SqlCommand("insert into table1 values('"+TextBox1.Text+"')",con);
SqlDataReader rr=com.ExecuteReader();
}
}
----------------------------
CS0103: The name 'TextBox1' does not exist in the current context
Line 24: {
Line 25: SqlConnection con = new SqlConnection("Server=localhost;uid='sa';pwd='sa';DataBase=master");
Line 26: SqlCommand com=new SqlCommand("insert into table1 values('"+TextBox1.Text+"')",con);//this line in Red Color(error portion)
Line 27: SqlDataReader rr=com.ExecuteReader();
Line 28:
|
|
|
|
|
Ok
System.Web.UI.WebControls.TextBox control = (System.Web.UI.WebControls.TextBox)this.form1.FindControl("COntrolID");
This may help you
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
hi,
lets say i have a an application which has few pop ups. However by default the browser denies the popups.
So is there a way that i can provide settings to my application that it should allow popups for the specific application.
Can we do this thru .net???
Gautham
|
|
|
|
|
|
|
Hi all, is it possible to pass parameter inside a web user control from ASPX pages, and how could i do to retrieve this value inside the web user control? Thanks a lot. vamsi
ALL THE BEST
|
|
|
|
|
Hi,
a webusercontrol acts as a childpage to the basepage i.e aspx page.
So a public method in the webusercontrol can be accessed from the main page.
for eg: in the page_load of the main page (.aspx) a call can be made to the public method present in the webusercontrol.
webusercontrol1.populate(string name);....where populate is the method present in the webusercontrol
Is this the thing u want?
Koushik
|
|
|
|
|
Yes
Suppose you have usercontrol name MyControl.ascx which is used in MyPage.aspx
then write a method with all paramaters you want to send to use control
call this method from your MyPage.aspx.cs as
MyControlObject.MethodName(ParameterList)
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
when a coloumn is made visible=false
its data is not accessed.
but i want to access it how can i do it
|
|
|
|
|
Hi
Use a Template field and make it to visible = false.
Add Hidden Field inside the template field.
To get value from the hidden field.
HiddenField hdField = (HiddenField) e.Row.FindControl("Your Hidden Field ID");
You will get value using the variable 'hdField'
That is it.
Rate this message. Thank you. Harini
|
|
|
|
|
How can i get week number on selected date.After selecting the data from the calender,Date to be display on the date textbox and the week number to be displayed on the week number text box automatically.
oga m
|
|
|
|
|
in the calender selectionchanged event place the following code.
for eg:
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
System.Globalization.Calendar cal=System.Globalization.CultureInfo.InvariantCulture.Calendar;
WeekTxt.Text= (cal.GetWeekOfYear(Calendar1.SelectedDate, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Monday)).ToString();
DayTxt.Text = this.Calendar1.SelectedDate.ToShortDateString();
}
Koushik
|
|
|
|
|
I want to add RMA to my online shopping cart . How to start . Any Idea about that.
Thanks in ADVANCE
|
|
|
|
|
|
Hi,
please help me in, converting DRM protected Audio/Video files to unprotected audio/video files. We can get DRM protected audio/video files from iTune i.e., from Apple website. The files which are present in iTunes will not play in our pc's and ordinary players, because the files are DRM protected. So to play in our pc's and ordinary players we have to remove DRM protection and convert those file format to MPEG or AVI or WMV or MP3 file format.
Bala
|
|
|
|
|
|
Yes it is legal to convert DRM protected file to unprotected file.
There is already software with same functionality with the name Tunebites(www.tunebite.com), u can see the software.
Bala
|
|
|
|