|
<asp:calendar id="Calendar" runat="server" width="75" selecteddate="01-01-2007"
="" onselectionchanged="Date_Selected" dayheaderstyle-backcolor="ActiveBorder" daynameformat="Short" font-names="Verdana;Arial" font-size="12px" height="180px" todaydaystyle-font-bold="True" dayheaderstyle-font-bold="True" othermonthdaystyle-forecolor="gray" titlestyle-backcolor="#3366ff" titlestyle-forecolor="white" titlestyle-font-bold="True" selecteddaystyle-backcolor="#ffcc66" selecteddaystyle-font-bold="True" nextprevformat="ShortMonth" nextprevstyle-forecolor="white" nextprevstyle-font-size="10px" selectorstyle-backcolor="#99ccff" selectorstyle-forecolor="navy" selectorstyle-font-size="9px" selectweektext="week" selectmonthtext="month" ondayrender="Calendar_DayRender">
<asp:button id="btnsubmit" runat="server" text="Select the Date" onclick="btnsubmit_Click">
<asp:label id="lblcal" runat="server" width="50%">
|
code to get checkbox in calender control:
//function to get checkbox in calender
protected void Calendar_DayRender(object sender, DayRenderEventArgs e)
{
CalendarDay cd = e.Day;
string cid = "" + e.Day.Date.ToString("ddmmyyyy");
cb.ID = cid;
e.Cell.BackColor = Color.BurlyWood;
//e.Cell.BackColor = Color.Yellow;
DateTime theDate = e.Day.Date;
if (cd.IsWeekend)
{
e.Cell.BackColor = Color.Brown;
// e.Cell.BackColor = Color.SkyBlue;
}
e.Cell.Controls.Add(cb);
}
//function to display the date selected by user
protected void btnsubmit_Click(object sender, EventArgs e)
{
if (cb != null)
{
if (cb.Checked)
{
lblcal.Text = Calendar.SelectedDate.ToShortDateString();
}
//else
//{
// lblcal.Text = "No Date is Slected!";
//}
}
Response.Write("The selected date is :" + Calendar.SelectedDate.ToShortDateString());
}
hope this wuld help u.
|
|
|
|
|
Sorry for saying this... This cannot be done...
You are adding controls in the Calendar in the DayRender Event which has some no. of controls.. Say 30 checkboxes... When you click the button you are getting only one control "cb" which would be the last control and it won't be last control that time...
When you click the button, the page is postback and all the controls are cleared (i.e) CalendarControl.Controls.Count=0. We can't get the checkboxes now..
I tried with accessing directly by CalendarControl.FindControl("03012007"), but it is hope less...
Don't waste your time in doing this... Try some other way... .NET Calendar has limited advantages... If you know AJAX then, you can do it... But it take time to studying and doing..
Have a nice day..
Regards,
Venkatesh Mookkan.
Software Engineer, India
|
|
|
|
|
what is the exact meaning of the configuration in asp.net.and what is use of machine.config and when is it used.
thanks in advance.
|
|
|
|
|
"web.config" is scoped to a particular directory.
You use it to override "machine.config" for a particular application or application sub-folder.
Regards,
Venkatesh Mookkan.
Software Engineer, India
|
|
|
|
|
thanks for reply i want to know what is the exact meaning for the configuration.how many types of confid are there.
|
|
|
|
|
|
Hi, My question is this .. I am creating an email sender using asp.net 1.1. Now I am using an smtp called smtp.mail.yahoo.com.
This is the code i am using:
objEmail.SmtpServer = "smtp.mail.yahoo.com"
Now, when I am sending the email, an error message occurs telling me "CTO.message object error"
Why is this please?? Thanks alot.
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
If i am not wrong this is not your SMTP server. This is yahoo server. So you need to use your server.
Amit
|
|
|
|
|
Yes, its not my smtp but my smtp is of godaddy and it isn't working the same. i don't know what to do. I made another code just like this but the emails sent but nothing was really sent.
objEmail.SmtpServer.Insert(0, "smtpout.secureserver.net")
This code is not good I think. Can someone help please. Thanks alot
Regards,
Adrian
www.maltatrade.org
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
The problem is that most public servers flat out won't let you do this, otherwise they'd be deluged with spam - so relaying is generally blocked.
You need (as a previous poster told you) to use your OWN smtp server, or a public one that allows relaying (good luck!)....as a hint, SQL Server has one
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
WHAT IS MY SMTP SERVER AND HOW CAN I KNOW MY SMTP PLEASE?? I AM USING AN MS ACCESS NOT SQL .. THANKS FOR YOUR HELP!!
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Please don't shout....
ADY007 wrote: WHAT IS MY SMTP SERVER AND HOW CAN I KNOW MY SMTP PLEASE
Which bit don't you understand? Your SMTP server is an SMTP server that you control ( ). If you're not using SQL server, IIS also has one built in.
If you still can't find one, try talking to your company's admins - most will let developers use it if they behave themselves, and failing that, you'll just have to look for one of your own to download....plenty of them kicking around - try Google.
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi, I read an article that said web controls caused performance problems when the application had much traffic.
But I have forgotten the link, does someone knows an article about this subject?
Thanks.
//Victor Blomberg, victor-y.com
|
|
|
|
|
|
Thanks!
But the content of that article I read where that you could not use web controls at all in certain situations. And yes, I have tested google, but unfortunately did I not found the article.
//Victor Blomberg, victor-y.com
|
|
|
|
|
Hey Victor,
Like I said earlier, there are lots and lots of articles floating on the internet about improving web applications (asp.net in particular). I don't know where you heard such harsh/radical statements about asp.net controls... in one of my projects I went crazy with the web controls, and the web site was just fine as far as performance.
Here is my advice:
1) If you need to trigger/handle an event only on the "client" side, use html controls (with JavaScript, of course).
2) If you need to make the roundtrip to the server, but you do NOT need to maintain any data being persisted within that control, use web control BUT make sure to set its ViewState property to False.
3) Avoid asp.Panel controls whenever possible, instead, use the good old html table
4) If you are using GridView that is connected to only ONE data source, you can set that GridView's ViewState property to false. This is because generally data controls data bind dynamically at each page load.
5) Put as much burden as possible on your client, learn to implement AJAX, and avoid postbacks.
6) Masterpages are convenient and look cool (I have three of them nested in one of my projects), but in the end they will be rendered as one GIANT page with a BIG ViewState and many web controls... long story short, keep your pages simple.
7) Make sure your app is NOT in debug mode after deployment.
8) Cache your web controls
9) ...the list goes on and on!
Nila
|
|
|
|
|
FIXED - CORRUPTED RECORDS IN DATABASE WERE THE PROBLEM
I'm using this code to retrieve images from an SQL Server DB. For some reason all the images are blurry. Anybody know why? I've verified the images stored in the DB are not blurry so I find it strange.
http://www.samspublishing.com/articles/article.asp?p=377078&seqNum=2&rl=1[^]
- Rex
Last modified: 7hrs 13mins after originally posted --
|
|
|
|
|
The strange thing is that it's not doing it to every image. Some look great and some look blurry and it's all using the same code. Is there something I need to do to repair images in SQL Server...
|
|
|
|
|
What format are your images in? What are you downloading them as?
More importantly, blurry images normally mean that the size does not match the original size. So, a 320x280 image will appear blurry if viewed at 300x270.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I'm using that code almost verbatim. Every image is a jpeg and I batch sized all of them down for huge 3+ meg images to 200Kb on average images using "Easy Thumbnails" which will do more than just thumbnails. It's a nice product to just give away.
Oddly all of the images from Easy Thumbnail look great on disk and some of them look bad out of the DB. Here's my actual code (the output parameter is the URL parameter of the Image):
if (Request.QueryString["ImgID"] != null && Request.QueryString["Orientation"] != null)
{
System.Int32 _ImgID = Convert.ToInt32(Request.QueryString["ImgID"].ToString().Trim());
string _Orientation = Request.QueryString["Orientation"].ToString().Trim();
HttpContext.Current.Session["PrevID"] = _ImgID;
SqlDataReader thisReader = null;
SqlConnection thisConn = new SqlConnection(ConfigurationManager.ConnectionStrings["MediaGalleryConnectionString"].ConnectionString);
SqlCommand thisCmd = new SqlCommand("Command String", thisConn);
tmpStr = "Select PageImage, PageText from PhotoGallery WHERE RecordID='" + _ImgID.ToString() + "'";
thisCmd.CommandText = tmpStr;
try
{
thisConn.Open();
thisReader = thisCmd.ExecuteReader(CommandBehavior.CloseConnection);
while (thisReader.Read())
{
System.Drawing.Image _image = System.Drawing.Image.FromStream(new System.IO.MemoryStream((byte[])thisReader["PageImage"]));
System.Web.HttpContext.Current.Response.ContentType = "image/jpeg";
if (Request.QueryString["Orientation"].ToString().Trim() == "Landscape")
{
System.Drawing.Image _newimage = _image;
_newimage.Save(System.Web.HttpContext.Current.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
}
else if (Request.QueryString["Orientation"].ToString().Trim() == "Portrait")
{
System.Drawing.Image _newimage = _image;
_newimage.Save(System.Web.HttpContext.Current.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
}
}
}
catch{}
finally{}
}
|
|
|
|
|
Got it. Corrupted images in the database. I delete the entire record. Recreate it with a new PK/Index and it's all good. Strange.
- Rex
|
|
|
|
|
Hi All,
I am using DataGrid Control to ASP.NET,C# Web Application.
I have added template column for Data Grid and added Image button for ItemTemplate.
Now I need to fire Click event when Image button Pressed on a Perticular Data Row .
There are 20 or More rows in a DataGrid.
Can any one tell me how to bind ClickEvent for ImageButtons on a Template Column?
Thanks in advance.
|
|
|
|
|
Hi,
You can use oncommand for the imagebutton. Add an image button to your template like so.
<<asp:imagebutton commandargument="ValueYouPassIN" commandname="ImageClick" oncommand="ImageClick_Command" id="ImageButton1" runat="server">
Then just create a method that does what you want.
<br />
protected void ImageClick_Command(object sender, CommandEventArgs e) <br />
{<br />
Response.Write("test");<br />
<br />
} <br />
<br />
Regards
tom
|
|
|
|
|
hi there,
when redirect to another page using response.Redirect() ,it generates
an http get operation , i want to change the headers for that (get) to add cookie , i tried to use respnse.AddHeader(), request.Headers.Add() but didn't work ,it is urgent thanks
|
|
|
|
|
I'm sure this has been posted a million times before, but how do i force my footer stay at the bottom of my browser, even if the content is too small to push it down.
Posted by The ANZAC
|
|
|
|