|
Solution is right here given by Tod.
Regards
Nitin
|
|
|
|
|
You didn't mention popup in your original question.
only two letters away from being an asset
|
|
|
|
|
What you need is a reference to the window of the page that you want to access.
If Page2 is a window opened by Page1 , you get a reference to the window containing Page2 as the return value of the call to the window.open method. You get a reference to Page1 by using window.opener .
Let's say that the variable win contains a reference to the window, then you can access the document property of the window, and use that to access it's content. Example:
win.document.getElementById('SomeControl').value = 'Hello world!';
In some cases it might not work well to directly access elements of a different page. Then you can call a function in the page that accesses the element:
win.document.someFunction('Hello world!');
function someFunction(text) {
document.getElementById('SomeControl').value = text;
}
---
b { font-weight: normal; }
|
|
|
|
|
Is there any inbuild library for emails sending in ASP.net 2.0 as was there in Classic ASP
Regards
|
|
|
|
|
|
Hello
I need a Help from the developers ......
i need to do a thing which look like simple but i can't find the way to do that .. so please update me if anyone knows this.
i am using a variable which store the name of the control as u can say :
string storecontrol = "textbox1";
and i need a method so that i can give only
storecontrol.text
and access the text in the corresponding textbox...as
console.WriteLine(storecontrol.Text);
and it will print the value of the textbox1.Text
If anyone knows this , then reply it..
Dotnetjunkie.....
|
|
|
|
|
If you know the parent of the control, you can use the FindControl method to locate the control.
---
b { font-weight: normal; }
|
|
|
|
|
If you can't use findparent, you could use reflection [assuming you are working in code behind]:
public void foo()
{
string TextBoxName ="txtBar";
TextBox requiredBox = GetBoxByName(TextBoxName);
requiredBox.Text = "New Value";
}
protected TextBox GetBoxByName(string name)
{
Type t = this.GetType();
FieldInfo fi = t.GetField(name);
return fi.GetValue(this) as TextBox;
}
I've not tested this properly, so don't be surprised if it doesn't work. If you want to specify which property you want (in your example .Text) you could create a GetProperty method running along the lines of "GetBoxByName" which uses reflection to find the property you want.
|
|
|
|
|
hi
i have an array which contain some values .i want to pass this array to javascript function from codebehind file.How to do this?
thanks
vijay
|
|
|
|
|
You can't do that.
What you can do is to create Javascript code that will recreate the array. For an example an array of integers:
int[] values = new int[] { 1, 2, 3, 4 };
StringBuilder code = new StringBuilder();
bool first = true;
foreach (int v in values) {
code.Append(first ? "var values = [" : ", ");
first = false;
code.Append(v);
}
code.Append("];");
Page.ClientScript.RegisterStartupScript(this.GetType(), "ValuesArray", code.ToString(), true);
---
b { font-weight: normal; }
|
|
|
|
|
i would like to pop out a message box when the user click the delete button to ensure the user really want to delete the data, when i put the code messagebox.show(xxxxx), it cannot run, is it want to import any namespace for it ?
thanks.
Best regards,
Chee ken
|
|
|
|
|
You can use javascript confirm for the same purpose.
Best Regards,
Apurva Kaushal
|
|
|
|
|
How to write the javascript ? and i search from msdn, the sample of the messagebox is like messagebox.show() , why my web cannot run ? i so blur. Hope you can answer me , thanks !
Best regards,
Chee ken
|
|
|
|
|
Actually when a user clicks on the delete button, it is not at all required to go to the server and show the confirmation message. Inspite you can use javascript for that it will remain there in client side only. And suresh has given the complete sample code for that.
Best Regards,
Apurva Kaushal
|
|
|
|
|
function confirm_delete()
{
if ( confirm( "Are you sure you want to delete the Record?") == true )
return true;
else
return false;
}
try this javascript in ur html view code
and
write this code in ur itemcreated event of grid
try
{
if ( e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem )
{
_myButton.Attributes.Add("onclick", "return confirm_delete();");
}
}
regards,
suresh
suresh babu.k
|
|
|
|
|
Your message box - it might appear on your web server...
|
|
|
|
|
You are correct in sense that the code is executed on the server, so if a message box would appear, it would appear on the server.
The ASP.NET environment is specified as not having any user interface, though, so an attempt to display a message box will cause an exception.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for all helping me, i know how to do it already. ;)
Best regards,
Chee ken
|
|
|
|
|
Kindly let me the easiest way of learning ASP.NET
|
|
|
|
|
Get some books and start reading that. Also practice(write code) a lot.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Kindly suggest some good books.
Regards
Dev Brar
|
|
|
|
|
You can check these books they are really good:
Pro ASP.NET 2.0 in C# 2005 from Apress
Programming ASP.NET by Jesse Liberty and dan Hurwitz
Essential ASP.NET With Examples in C#
Best Regards,
Apurva Kaushal
|
|
|
|
|
Asp.net2.0 books by wrox publication.
With Regards
Satips
|
|
|
|
|
And ofcourse Code Project Articles..
Best Regards,
Apurva Kaushal
|
|
|
|
|
hi,
I think wrox publications is better for asp.net
suresh babu.k
|
|
|
|