|
i want the code for the calendar control in popup window using(asp.net with C# as backend)for on image button in the main window. please try for this . i hav to submit my project. thanq........
mallika
|
|
|
|
|
Create a form named Calender.aspx which has the following controls:
<asp:Calendar ID="calDate" Runat="server" CellPadding="0" />
<input type="hidden" id="control" runat="server" NAME="control">
Calender.aspx.cs do this:
private void calDate_SelectionChanged(object sender, System.EventArgs e)
{
control.Value = calDate.SelectedDate.ToShortDateString();
Response.Write("<script language='javascript'>window.returnValue='" + calDate.SelectedDate.ToString("dd/MM/yyyy") + "';window.close();</script>");
}
Finally on button on which u have to open Calender.aspx do this:
function PickFromDate()
{
var winSettings = "dialogWidth:300px;dialogHeight:250px; help: no; status: no";
var values = window.showModalDialog('Calender.aspx','cal',winSettings);
if (values)
{
document.all("txtFromDate").value = values;
}
}
<asp:textbox id="txtFromDate" runat="server" CssClass="TextBox" Width="180px"></asp:textbox>
<A onclick="PickFromDate();" href="javascript:;"><IMG class="LinkButton" height="17" alt="Pick Date" src="../Images/icon_calendar.gif" width="25" border="0">
Hope this helps u??
|
|
|
|
|
Thank you very much.
I got a popup window but when i am selecting the date its not displaying in the text box.
Please help me in doing this successfully.
mallika
|
|
|
|
|
Pass textbox's ID to popup window and write belove code on Calendar1_SelectionChanged
Response.Write("<script language = javascript>opener.document.getElementById(Request.QueryString["ID"]).value='" + (Calendar1.SelectedDate) + "'; self.close();</script>");
bEST rEGARD
pATHAN
please don't forget to vote on the post that helped you.
|
|
|
|
|
|
how to create dialog box in asp.net 2.0
Gayatri
|
|
|
|
|
No you cant create any kind of dialog boxes in ASP.net.. Only VB.net supports this dialog box options...
Regards
Sivan.G
|
|
|
|
|
You may start with this link:
http://dotnetjunkies.com/Article/A72FCFD7-3874-408A-8FCE-541BEC74C704.dcik
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
Sivan.G wrote: Only VB.net supports this dialog box options...
Correction:
Only VB.net <big>Windows Forms Applications</big> supports this dialog box options...
|
|
|
|
|
Sorry For that and thanks for u r corrections.....
Regards
Sivan.G
|
|
|
|
|
hello frnd,
Can i give caption/Title to confirm box in javascript ???
please help
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Sorry that's not possible in Javascript..
try it using VBscript...
Regards
Sivan.G
|
|
|
|
|
koolprasad2003 wrote: Can i give caption/Title to confirm box in javascript ???
No you can't
|
|
|
|
|
No, in JavaScript
Yes, in VBScript
|
|
|
|
|
i am using datagrid on clikcing edit button upload control is display
the code is
ON Updatecommand of datagrid i m writing the code
Dim pid As Integer = Val(e.Item.Cells(1).Text)
Dim upload1 As FileUpload = CType(e.Item.FindControl("UpRSPictureedt"), FileUpload)
Dim objcmaint As New ClsMaintenence
If Not IsNothing(upload1) Then
intImageSize = upload1.PostedFile.ContentLength
(AT THIS POINT IT IS GIVING ERROR AS OBJECT NOT SET TO REFRENCE )
strImageType = upload1.PostedFile.ContentType
' Reads the Image
please suggest me
|
|
|
|
|
try using
if upload1.HasFile then
end if
Paras Kaneriya The difference between genius and stupidity is that genius has its limits.
|
|
|
|
|
this code i m using in datagrid html
<asp:templatecolumn headertext="IncidentPicture">
<itemtemplate>
" target="new">ViewPicture
<edititemtemplate>
<asp:fileupload id="UpRSPictureedt" runat="server">
when user clicks the update button i m taking update method ,updating upload control as follows
Dim upload1 As FileUpload = CType(e.Item.FindControl("UpRSPictureedt"), FileUpload)
but here when i m checking upload1.hasfile or upload1.postedfile,it is null so please suggest me how to capture it when updating the uploadcontrol
|
|
|
|
|
<asp:templatecolumn headertext="IncidentPicture">
<itemtemplate>
<<%#Container.DataItem("InciPicID")%>"
<edititemtemplate>
<asp:fileupload id="UpRSPictureedt" runat="server">
when user clicks the update button i m taking update method ,updating upload control as follows
Dim upload1 As FileUpload = CType(e.Item.FindControl("UpRSPictureedt"), FileUpload)
but here when i m checking upload1.hasfile or upload1.postedfile,it is null so please suggest me how to capture it when updating the uploadcontrol
|
|
|
|
|
<%--<asp:templatecolumn headertext="IncidentPicture">
<itemtemplate>
<<%#Container.DataItem("InciPicID")%>"
<edititemtemplate>
<asp:fileupload id="UpRSPictureedt" runat="server">
--%>
when user clicks the update button i m taking update method ,updating upload control as follows
Dim upload1 As FileUpload = CType(e.Item.FindControl("UpRSPictureedt"), FileUpload)
but here when i m checking upload1.hasfile or upload1.postedfile,it is null so please suggest me how to capture it when updating the uploadcontrol
|
|
|
|
|
<%--<asp:templatecolumn headertext="IncidentPicture"><itemtemplate><%#Container.DataItem("InciPicID")%>"<edititemtemplate> <asp:fileupload id="UpRSPictureedt" runat="server">--%>
when user clicks the update button i m taking update method ,updating upload control as follows
Dim upload1 As FileUpload = CType(e.Item.FindControl("UpRSPictureedt"), FileUpload)
but here when i m checking upload1.hasfile or upload1.postedfile,it is null so please suggest me how to capture it when updating the uploadcontrol
|
|
|
|
|
11<asp:TemplateColumn HeaderText="IncidentPicture">
<ItemTemplate>
<<%#Container.DataItem("InciPicID")%>" </ItemTemplate>
<EditItemTemplate>
<asp:FileUpload ID="UpRSPictureedt" runat="server" />
</EditItemTemplate>
</asp:TemplateColumn>
when user clicks the update button i m taking update method ,updating upload control as follows
Dim upload1 As FileUpload = CType(e.Item.FindControl("UpRSPictureedt"), FileUpload)
but here when i m checking upload1.hasfile or upload1.postedfile,it is null so please suggest me how to capture it when updating the uploadcontrol
|
|
|
|
|
MD12 wrote: If Not IsNothing(upload1) Then
if(upload1.HasFile) then
Best Regard
Pathan
please don't forget to vote on the post that helped you.
|
|
|
|
|
11<asp:TemplateColumn HeaderText="IncidentPicture">
<ItemTemplate>
<<%#Container.DataItem("InciPicID")%>" </ItemTemplate>
<EditItemTemplate>
<asp:FileUpload ID="UpRSPictureedt" runat="server" />
</EditItemTemplate>
</asp:TemplateColumn>
when user clicks the update button i m taking update method ,updating upload control as follows
Dim upload1 As FileUpload = CType(e.Item.FindControl("UpRSPictureedt"), FileUpload)
but here when i m checking upload1.hasfile or upload1.postedfile,it is null so please suggest me how to capture it when updating the uploadcontrol
|
|
|
|
|
1) Verify whether UpRSPictureedt has a RUNAT=server attribute. Custom manually typed controls normally, we skip and create this error.
2) upload1.PostedFile should be checked for NULL
|
|
|
|
|
11<asp:TemplateColumn HeaderText="IncidentPicture">
<ItemTemplate>
<<%#Container.DataItem("InciPicID")%>" </ItemTemplate>
<EditItemTemplate>
<asp:FileUpload ID="UpRSPictureedt" runat="server" />
</EditItemTemplate>
</asp:TemplateColumn>
when user clicks the update button i m taking update method ,updating upload control as follows
Dim upload1 As FileUpload = CType(e.Item.FindControl("UpRSPictureedt"), FileUpload)
but here when i m checking upload1.hasfile or upload1.postedfile,it is null so please suggest me how to capture it when updating the uploadcontrol
|
|
|
|