|
|
How would Session Variables work?
Example:
I have a .aspx page with 1 text box on it called textbox1
After this control I have a control called button.ascx
When I load this page I click on the button which is in the control and I want it to redirect me to the URL that I have typed in textbox1 but I can't seem to access textbox1 from button.ascx
How would I do this?
Thanks,
Gavin
|
|
|
|
|
assuming the textbox and button control are on the same page then (PS - I just worked this out myself [yesterday I discovered the Application/Session objects])
I made the textbox on the page public rather than protected
then in my handler for the button I did this
private void Button1_Click(object sender, System.EventArgs e)
{
WebForm1 page = (WebForm1)Page;
Response.Redirect(page.TextBox1.Text,true);
}
I know it could be done better but I am just learning
Holy Handgrenade of Antioch instructions
|
|
|
|
|
Perfect, now I can redesign my entire site.... hmm maybe not the best idea..
Good to know for the future though
Thanks,
Gavin
|
|
|
|
|
|
I set mine up by either placing them inside a HTML table or by using the style tag.
HTH
|
|
|
|
|
|
What limitations exist for an ASP.NET webapplication as ragards a straight C# application.
I am trying to learn C# but I also need to know more about ASP.NET and since I can do the server side stuff in C# I thought I could combine the two tasks.
however I suspect that the c# in webapplications would be limited in someway - maybe not - but I'd like to know before I start racking my head over something I can't do
Shaun
|
|
|
|
|
What limitations exist for an ASP.NET webapplication as ragards a straight C# application.
I am trying to learn C# but I also need to know more about ASP.NET and since I can do the server side stuff in C# I thought I could combine the two tasks.
however I suspect that the c# in webapplications would be limited in someway - maybe not - but I'd like to know before I start racking my head over something I can't do
Shaun
|
|
|
|
|
I am trying to deploy an ASP.Net project from my 2000 Pro box to my XP Pro box using the copy feature of VS.Net. I have successfully moved it to a 2000 Advanced server box. The problem is that when I try and move it to the XP box I am getting permission errors.
Now I have tried opening up the anonoymous access, logging on as Admin, etc and every conceivable thing I can think of with no luck. .Net simply refuses to allow me to copy the ASP.net app to this IIS server.
I have also verified that the 2000 Advanced server has the identical IIS settings as the XP box except for those settings that Advanced server provides which are not on the XP Pro version of IIS such as Operators.
Any thoughts as to why this is causing me such grief and how to fix it would be greatly appreciated
|
|
|
|
|
Have you tried making a 1 page ASP.NET project and seeing if you still get the same errors?
Cheers,
Simon
"Every good work of software starts by scratching a developer's personal itch.", Eric S. Raymond
|
|
|
|
|
Actually the test case I am trying is a single ASPX file. It works if I pull the data to the server as opposed to puching it from my development box. Unfortunately I wouln't always have that luxury if I need to push to a third party host.
|
|
|
|
|
I have a datagrid with a lot of columns that I need to creat a sql update statement from. Most of the examples do something like the following:
TextBox hours = (TextBox)objArgs.Item.FindControl("hours");
TextBox days = (TextBox)objArgs.Item.FindControl("days");
TextBox userid = (TextBox)objArgs.Item.FindControl("userid");
.... repeat for all controls in the grid
string sql = "update userinfo set hours = " + hours.Text + ", days = " + days.Text + " where userid = " + userid.Text;
As you can imagine this take a lot of code for a table with a lot of columns.
Is there a way to enumerate the bound columns of a datagrid? Something like:
string sql = "update userinfo set ";
foreach (BoundColumn column in myDataGrid)
{
sql += column.Name + " = " + column.Text ", ";
}
would be really nice.
Todd Smith
|
|
|
|
|
I believe you need to do it this way.
private void OnUpdate(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
TextBox text = (TextBox)e.Item.FindControl("Edit1");
Label label = (Label)e.Item.FindControl("Label1");
}
|
|
|
|
|
Hi all,
I have one iframe element on my aspx page. I want to pass the content of the
iframe back to the
codebehind file for saving to the database. Is there any way to grab this
information and post back?
Peter Marino
IO Interactive
|
|
|
|
|
Like subject says... I have problems when including a file more than once,
so having something like a #define would avoid including a file twice.
I'd also like to use that for creating a language file, so to translate my
website, I'd only have to modify that file...
Thanks!
I just found out that Const would do that for me, but now I need an equivalent to #ifdef, #else and #endif...
---------------
http://www.edovia.com
|
|
|
|
|
Hi All,
I am using ASP.NET and C#
I would presume this is an easy question but I can't seem to find any information about it.
I would like to add a button to my webpage that when clicked acts just like the print option of Internet Explorer. ie. Brings up a box to ask you what printer you want to print.
I'm sure there must be a straight function that I can call, something like Document.Print?
Thanks,
Gavin
|
|
|
|
|
code example:
<SCRIPT Language="Javascript">
function printit(){
if (window.print) {
window.print() ;
} else {
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(6, 2);
}
}
</script>
<SCRIPT Language="Javascript">
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3) {
document.write('<form><input type=button value="Print this Page" name="Print" onClick="printit()"></form>');
}
</script>
source: http://www.dynamicdrive.com/dynamicindex9/other1.htm
|
|
|
|
|
Thanks a million,
Works like a treat
|
|
|
|
|
I was wondering if anyone knew if connection pooling will work with an as/400 backend?
Thanks
|
|
|
|
|
What are your favorite ASP.NET sites for learning more complex stuff?
Todd Smith
|
|
|
|
|
Start with www.asp.net? It is a Microsoft maintained site
|
|
|
|
|
There are many web hosting provider, but they don't support ASP ?.If you know any please tell me.
Thank you very much.
|
|
|
|
|
My "preferred" Hosting provider for ASP.NET is WebStrikeSolution.com! They offer a nice package for ASP.NET and the price is hard to beat! Check it out: http://www.webstrikesolutions.com/windows.html
I had been using the Web Hosting provided by my ISP (included with the service, however, the ISP Tech's just weren't up-to-speed with ASP.NET and I don't want to have to teach them as well as myself. So, I chose to switch and have been happy so far!
Regards,
KoalaCowboy
Knowledge Monster Extraordinaire
|
|
|
|
|