|
This[^] should do the trick.
|
|
|
|
|
Thanks, I saw your post just after I posted my last one, I will check it out...
J
- Artificial intelligence is no match for natural stupidity
|
|
|
|
|
That's a good link, thank you!
J
- Artificial intelligence is no match for natural stupidity
|
|
|
|
|
After posting this I decided to play a little more, and I think I got it, hope this helps someone...
I created a user control in the folder "Controls" called "WebUserControl.ascx".
I decided if I could write the control programatically to the page, I could then use that variable later for the email section.
Here is the code I came up with... if anyone can better it, please post here:
using System;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Text;
using System.IO;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
System.Text.StringBuilder stringBuilder = new StringBuilder();
StringWriter stringWriter;
HtmlTextWriter htmlTextWriter;
stringWriter = new System.IO.StringWriter(stringBuilder);
htmlTextWriter = new HtmlTextWriter(stringWriter);
Control c1 = LoadControl("Controls/WebUserControl.ascx");
c1.DataBind();
c1.RenderControl(htmlTextWriter);
Response.Write (htmlTextWriter.InnerWriter.ToString());
}
}
J
- Artificial intelligence is no match for natural stupidity
|
|
|
|
|
happy new year all of u...
sir,
iam using dataservice function of type int[] named getunbookedslots(DateTime dt) and the same is used for adding the returned datetime value to RadioButtonList of other .aspx page dynamically...
here is the Code in Page_Load() of page aspx.cs....
DataService myservices = new DataService();
protected void Page_Load(object sender, EventArgs e)
{
string s = "";
DateTime dt = DateTime.Now ;
s = Request.QueryString["monthday"].ToString();
s = s + " " + Request.QueryString["monthdate"].ToString();
RadioButtonList lt = new RadioButtonList();
int[] value = myservices.getunbookedslots(dt);
lt.Items.Add(value.ToString());
cont.Controls.Add(lt);
Response.Write(s);
}
|
|
|
|
|
Use a data bound radiobutton list.
Also, avoid response.write. If you need to set a value, set it in a literal control.
premprakashbhati wrote: string s = "";
This is also stupid. You create a string then kill it. Use string.Empty where needed, and it's not needed here, just set the string to your first value.
premprakashbhati wrote: s = Request.QueryString["monthday"].ToString();
The value that comes back from QueryString IS a string. Also, if there's nothing there, I am not sure if it will come back empty or null, if the latter, this will blow up.
premprakashbhati wrote: DateTime dt = DateTime.Now ;
This is crazy, why create a variable ?
premprakashbhati wrote: RadioButtonList lt = new RadioButtonList();
Don't create controls dynamically if you can avoid it. If you have an arbitrary number of radiobuttonlists, create them with a repeater.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi,
I am trying to create a multi language web application. I have set the culture="pa-IN" and the uiCulture="pa-IN". Now I have typed some text in simple html tags(<p>) and I have placed a calender control on the wep page. When I run the application, I am able to see the calender control contents(month & days name) changing to the culture selected, but the normal html contents didn't change, they are visible in english.
What can I do in this case?
Regards,
Royal
|
|
|
|
|
Royal Ludhiana wrote: they are visible in english.
ohhh!!! It should be!!
For That, You have to change the Browser Language settings . Change the Browser Language as per your requirement and Don't Forget to Set it English Again !!
Now How !!! Check This Section[^]
cheers,
Abhijit
|
|
|
|
|
Please Give Code For Using NAT in P2P Web Based Chat Application
Mail me On indramca@ymail.com
From,
Indra Patel
Gujarat
|
|
|
|
|
indramca wrote: Please Give Code For Using NAT in P2P Web Based Chat Application
No one here to give you code. We can help you if you stuck any where at the time of implementing something, but not post like that.
cheers,
Abhijit
|
|
|
|
|
Dear All
first of all (Happy New Year)
Now me problem is i want to create a website which is available in multiple language like.
hp.com
timex.com
Now what is the way i could achive the same. n many tutorials i found the solution for resource file, but i dont know the language other than English so i am unable to create file in other language.
So how could i create the multilanguage site.
Plz do reply
Regards
Yogesh Agarwal
|
|
|
|
|
You need to learn about Globalization in Asp.Net. And You have to also learn about global resources.
Check Here[^]
cheers,
Abhijit
|
|
|
|
|
Hi all,
iam getting the above error
OdbcDataReader objDR = objCmd.ExecuteReader();
if (!objDR.Read())
{
return false;
}
else
{
string storedHashedPassword = objDR("Password");
}
at this line
string storedHashedPassword = objDR("Password");
what iam doing wrong ?
Best regards
Rameez
|
|
|
|
|
else
{
string storedHashedPassword = objDR("Password");
}
should be
else
{
string storedHashedPassword = objDR["Password"].ToString();
}
modified on Thursday, January 1, 2009 3:16 AM
|
|
|
|
|
Try like this
string storedHashedPassword = objDR["Password"];
|
|
|
|
|
Try objDR["Password"].ToString()
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
meeram395 wrote: Try objDR["Password"].ToString()
Always practice to do a sanity checking as objDR["Password"] may return NULL and you will end up with NullReferenceException .
|
|
|
|
|
Thanks for reply,
iam getting an other error that Formsauthentication does not exist in curent context .
let me know what i have to do for this error .
Thanks in advance
Best regards
|
|
|
|
|
rameez Raja wrote: let me know what i have to do for this error .
Looks like you need a ASP.NET book.
|
|
|
|
|
ROTFL !!!
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
That's also known as a 'learn to program before taking a job as a programmer' error.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi all,
I build in a navigation system inside the TabContainer. So there are tabpanel in tabcontainer. tere are four tabs and I want to move to the next tab when i click on the button.
I am also using this code:TabContainer1.ActiveTab = TabContainer1.Tabs[1];
but it's not working
also use javascript:
function MoveTab(num)
{
var container = $find('TabContainer1');
container.set_activeTabIndex(num);
}
but no solution.
If u have any idea about this,pls suggest me.
Thanks
monika
|
|
|
|
|
|
Can u post a sample code.
|
|
|
|
|
string url = Server.MapPath("~/IDS/" + dr["RmtMLRAddressImg"].ToString());
image1.imageurl= url;
umerumerumer
|
|
|
|