|
Wouldn't a rebuild also fix this up?
|
|
|
|
|
PErhaps, but a reboot is more likely to work
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
still the same problem after reboot.
do u have any other ideas?
thx
BiG RaLpH
|
|
|
|
|
Try Re-installing .NET Framework,
Bhaskar Shetty
|
|
|
|
|
I re-installed it and nothing happened
any other Ideas?
BiG RaLpH
|
|
|
|
|
Hi,
I am using the datetimepicker control code which is given in this site.I am using vs.net 2005 (Master and content pages)
I have a content page as below
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" MasterPageFile="~/MasterPage.master" %>
<asp:content contentplaceholderid="dataPlaceHolder" id="content1" runat="server">
<asp:button id="abc" text="clickme" runat="server">
|
Now when I click the button I am opening a modal window using javascript function
abc.Attributtes.Add("onclick","javascript:openwindow('abcd.aspx','newwin')");
javascript function
var winpop = null;
function openwindow(url,name) {
winpop = window.showModalDialog(url,name,'dialogwidth:700px;dialogHeight:600px');}
if (!document.all)
{
document.captureEvents (Event.CLICK);
}
document.onclick = function()
{
if (winpop != null && !winpop .closed)
{
winpop .focus();
}
}
In the modal window I am using the calendarcontrol as below
<cc1:datetimepicker id="DateTimePicker1" runat="server" formattype="short">(mm/dd/yyyy)
| <asp:textbox id="id1" runat="server">
| <asp:textbox id="id1" runat="server">
|
One more problem is when I use the webcustomcontrol in the showmodaldialog window,it has some textboxes below the datetimepicker control.when I click on the button to select the date, the textbox controls which are below the datetimepickercontrol are moving down automatically and also when I select the date, application gets hanged up.
the above control is a webcustomcontrol . the code is below for it.
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Drawing;
using System.Web.UI.HtmlControls;
using System.Web.UI.Design;
using System.ComponentModel.Design;
namespace DTPicker
{
///
/// Summary description for WebCustomControl1.
///
[DefaultProperty("Text"),
ToolboxData("<{0}:DateTimePicker runat=server>")]
[
Designer("DTPicker.MyDesigner")
]
public class DateTimePicker : System.Web.UI.WebControls.WebControl,INamingContainer
{
private TextBox dArea=new TextBox();private Calendar cal=new Calendar();
public DateTimePicker()
{
visibility=false;
SelectedDate="1/1/1";
FormatType="SHORT";
}
private bool visibility;
public string SelectedDate
{
get
{
return (string)ViewState["selecteddate"];
}
set
{
ViewState["selecteddate"]=value;
}
}
public string FormatType
{
get
{
return (string)ViewState["format"];
}
set
{
string val=(string)value;
ViewState["format"]=val.ToUpper();
}
}
protected void month_changed(object sender,MonthChangedEventArgs e)
{
visibility=true;
}
protected void date_changed(object sender,System.EventArgs e)
{
visibility=false;
SelectedDate=cal.SelectedDate.ToShortDateString();
}
protected override void CreateChildControls()
{
cal.VisibleMonthChanged +=new MonthChangedEventHandler(month_changed);cal.SelectionChanged +=new System.EventHandler(date_changed);
Controls.Add(dArea);
Controls.Add(cal);
base.CreateChildControls();
}
///
/// Render this control to the output parameter specified.
///
/// <param name="output" /> The HTML writer to write out to
protected override void Render(HtmlTextWriter output)
{
if(Visible)
{
dArea.Width=this.Width;dArea.Height=new Unit("20px");
//Display properties of Calendar Control
cal.BackColor=Color.White;
cal.BorderColor=Color.Red;
cal.BorderStyle=BorderStyle.Solid;
cal.BorderWidth=new Unit("4px");
cal.DayHeaderStyle.BackColor=Color.White;
cal.DayHeaderStyle.BorderColor=Color.Blue;
cal.DayHeaderStyle.ForeColor=Color.BlueViolet;
cal.DayNameFormat=DayNameFormat.Short;
cal.Font.Size=FontUnit.Smaller;
cal.ForeColor=Color.Black;
cal.Height=new Unit("169px");
cal.NextPrevFormat=NextPrevFormat.CustomText;
cal.NextMonthText=">";
cal.PrevMonthText="<";
cal.NextPrevStyle.BackColor=Color.Silver;
cal.NextPrevStyle.ForeColor=Color.Black;
cal.NextPrevStyle.HorizontalAlign=HorizontalAlign.Center;
cal.NextPrevStyle.VerticalAlign=VerticalAlign.Middle;
cal.OtherMonthDayStyle.ForeColor=Color.Silver;
cal.SelectedDayStyle.BackColor=Color.Black;
cal.SelectedDayStyle.BorderColor=Color.Red;
cal.SelectedDayStyle.BorderStyle=BorderStyle.Solid;
cal.SelectedDayStyle.BorderWidth=new Unit("4px");
cal.SelectedDayStyle.ForeColor=Color.White;
cal.Width=new Unit("189px");
cal.TitleStyle.BackColor=Color.Navy;
cal.TitleStyle.ForeColor=Color.White;
cal.TitleStyle.Font.Size=FontUnit.XSmall;
cal.TitleStyle.Font.Bold=true;
cal.TodayDayStyle.BackColor=Color.White;
cal.TodayDayStyle.BorderColor=Color.Red;
cal.TodayDayStyle.BorderStyle=BorderStyle.Solid;
cal.TodayDayStyle.BorderWidth=new Unit("4px");
cal.TodayDayStyle.ForeColor=Color.Black;
//Check for the format of the "SelectedDate Property".The format
//should be mm/dd/yy.If the format is wrong or the value of SelectedDate
//property is the default 1\1\1,the Selected Date becomes TodaysDate
string delim="/";
string[] cons=SelectedDate.Split(delim.ToCharArray());
int year=1;
int month=1;
int day=1;if(cons.Length==3)
{
year=Convert.ToInt32(cons[2]);
month=Convert.ToInt32(cons[1]);
day=Convert.ToInt32(cons[0]);
}
if(year>1 || month>1 || day>1)
{
if(!visibility)
{
cal.TodaysDate=new DateTime(year,day,month);
}
cal.SelectedDate=new DateTime(year,day,month);
if(FormatType=="SHORT")
dArea.Text=cal.SelectedDate.ToShortDateString();
else
{
dArea.Text=cal.SelectedDate.ToLongDateString();
}
}
else
{
cal.SelectedDate=cal.TodaysDate;
SelectedDate=cal.SelectedDate.ToShortDateString();
if(FormatType=="SHORT")
dArea.Text=cal.TodaysDate.ToShortDateString();
else
{
dArea.Text=cal.TodaysDate.ToLongDateString();
}
}
string uniqueID=this.UniqueID;//uniqueID generated for control
string spanID="main"+uniqueID;//ID of the span HTML control
string btnID=uniqueID+"btn";//ID of the button
string tdID=uniqueID+"td";//ID of the TD housing the Calendar
string hidID=uniqueID+"_a1";//ID of the input hidden control;helps in capturing BackButton
//controls the display property of Calendar
//The Calendar is hiding when the page is first loaded or when date changed event occurs
//The Calendar is visible when month change event occurs
//This variable controls the display style
string display;
string onloadfn=uniqueID+"setfocusonload()";//this fn gets executed when IFRAME loads
string togfn=uniqueID+"setfocusonclick()";//function executed on the onclicck eventof button...display calendar if invisible
string onblurfn=uniqueID+"hideCal()";//when a TD containing the Calendar loses focus...The calendar is made invisible
string onfocusfn=uniqueID+"showCal()";//when TD gets focus calendar is made visible
string donothing=uniqueID+"donothing()";
string onmouseoverfn=uniqueID+"getover()";
string onmouseoutfn=uniqueID+"getout()";
//render the dummy IFRAME tag
output.WriteLine("");
output.WriteLine("");
//render hidden control with value according to visibility required
//and the display property to be used for calendar
if(visibility==false)
{
output.WriteLine("");
display="none";
}
else
{
output.WriteLine("");
display="";
}
//start outputting the script
output.WriteLine("");
//Finished rendering the script portion
//Start rendering the Controls
//The Table which contains both TextBox and the button The syle attribute
//which is set by designer is applied,so that the absolute
//positioning of DateTimePicker is possible
output.Write("");
//'over' keeps track of the position of mouse...to check if button was clicked
output.WriteLine("over=0;");
//This function is executed on the load of IFRAME
//If the calendar is visible when page is loaded
//we simply give Calendar focus and set its z-Index property
//z-Index property controls 3D effect
//The function checks value of hidden control to see if Calendar
//is visible or otherwise.
output.WriteLine("function "+onloadfn);
output.WriteLine("{");
output.WriteLine("if(document.all('"+hidID+"').value==1)");
output.WriteLine("{");
output.WriteLine("document.all('"+tdID+"').focus()");
output.WriteLine("document.all('"+spanID+"')"+".style.zIndex=120;");
output.WriteLine("}");
output.WriteLine("}");
//This function is called when the button is clicked.This simply gives focus
//to the TD and also sets the z-Index property.The above function works
//when calendar is visible..this one works when it is invisible.
//This fn sets the value of hidden control to 1...
//setting this value to 1 gives the onload function above to set
//the z-Index property even if we use back button.This is because browsers
//caches the value of "<input>" controls of previous pages.Back Button of
//browser can become enabled when we change months
output.WriteLine("function "+togfn);
output.WriteLine("{");
output.WriteLine("if("+uniqueID+".style.display=='none')");
output.WriteLine("{");
output.WriteLine("document.all('"+tdID+"').focus()");
output.WriteLine("document.all('"+spanID+"')"+".style.zIndex=120;");
output.WriteLine("document.all('"+hidID+"').value=1;");
output.WriteLine("}");
output.WriteLine("}");
//The TD on losing focus hides the Calendar within it
//But if the lost focus occured due to the button click
//(indicated by over==1)the Cal won't get invisible sine
//the button click will be called immediately after this onblur event
//which will again cause it to be displayed...The only thing that we can
//do is somehow disable the click for once..This is
//done by assigning 'donothing' fn to it..which doesn't do anything
//with the calendar..it simply restores the eventhandler for button onclick
//so everything is back to normal.
output.WriteLine("function "+onblurfn);
output.WriteLine("{");
output.WriteLine("document.all('"+tdID+"').childNodes(0).style.display='none';");
output.WriteLine("if (over==1)");
output.WriteLine("document.all('"+btnID+"').onclick="+uniqueID+"donothing;");
output.WriteLine("}");
//When TD gets focus it simply makes the Calendar within it visible
output.WriteLine("function "+onfocusfn);
output.WriteLine("{");
output.WriteLine("document.all('"+tdID+"').childNodes(0).style.display='';");
output.WriteLine("}");
//As explained below this function simply restores the onclick handler
output.WriteLine("function "+donothing);
output.WriteLine("{");
output.WriteLine("document.all('"+btnID+"').onclick="+uniqueID+"toggleCal;");
output.WriteLine("}");
//Both the functions below help in checking if the onblur
//event of TD was the raised due to the button
output.WriteLine("function "+onmouseoverfn);
output.WriteLine("{");
output.WriteLine("over=1;");
output.WriteLine("}");
output.WriteLine("function "+onmouseoutfn);
output.WriteLine("{");
output.WriteLine("over=0;");
output.WriteLine("}");
output.WriteLine(" ");
output.Write("");
output.Write("");
output.Write("");
output.WriteLine("");
//render the textBox server control by using the RenderControl method
dArea.RenderControl(output);
//render the button tag..we need no server buttons..but normal HTML buttons
//changed the button height to 29px,previously it was 22px on 20th august
output.Write("");
output.Write("6");
output.WriteLine("");
output.Write(" | ");
//The style attribute as provided by designer is not possible for the span tag
//since it should come just below the textbox..this is done by incrementing
//the style attribute "TOP" by the height of the textBox
// I commented the code below as I do not want to specify the top,left,z-index properties as
// my control is in // string style=this.Attributes["style"];
// delim=";";
// string[] con=style.Split(delim.ToCharArray());
//
// for(int i=0;i<con.getlength(0);i++)
{
="" if(con[i].indexof("top")!="-1)
//" string="" delimiter=":" ;
="" string[]="" subcon="con[i].Split(delimiter.ToCharArray());
//" subcon[1]="subcon[1].Remove(subcon[1].IndexOf("px"),2);
//" int="" otop="Convert.ToInt32(subcon[1]);
//" newtop="oTop+Convert.ToInt32(dArea.Height.Value);
//" con[i]="subcon[0]+":"+newTop.ToString()+"px";
//" }
="" }
="" style="" for(int="" i="0;i<con.GetLength(0);i++)
//" style+="con[i]+";";"
=""
="" the="" <span=""> tag is needed since only some tags provide DHTML
//support for changing z-Index.SPAN is one of them
// Here I commented the span tag line with the style property and added line with only span
// id below
//output.Write("");
output.Write("");
output.Write("");
output.Write("");
//The TD which houses the calendar and which suitably hides and dispalys the
//calendar control which is its child.
output.Write("");
output.Write("");
output.Write("");
output.Write("");
output.Write("");
output.Write("");
output.Write("");
output.Write("");
//render the calendar control
cal.RenderControl(output);
output.Write(" | ");
output.Write(" | ");
output.WriteLine("");
}
}
}
public class MyDesigner:ControlDesigner
{
string width;public override bool AllowResize
{
get
{
return true;
}
}
public override string GetDesignTimeHtml()
{
string designTimeHtml;
DateTimePicker controlDesigned=(DateTimePicker)this.Component;
string dateDesignTime=controlDesigned.SelectedDate;
string format=controlDesigned.FormatType;Calendar cal=new Calendar();
string delim="/";
string[] cons=dateDesignTime.Split(delim.ToCharArray());
int year=1;
int month=1;
int day=1;
if(cons.Length==3)
{
year=Convert.ToInt32(cons[2]);
month=Convert.ToInt32(cons[1]);
day=Convert.ToInt32(cons[0]);
}
if(year>1 || month>1 || day>1)
{
cal.SelectedDate=new DateTime(year,day,month);
if(format=="SHORT")
dateDesignTime=cal.SelectedDate.ToShortDateString();
else
{
dateDesignTime=cal.SelectedDate.ToLongDateString();
}
}
else
{
dateDesignTime="The date given is in wrong format";
}
width=this.Behavior.GetAttribute("Width",true).ToString();
designTimeHtml=""+"6";
return designTimeHtml;
}
}
}
Now when I click the calendar control and select the date in the modal window.date is not selected.application is hanged up.
thanks
|
|
|
|
|
No-one is going to read all of this. If you have a problem with a control from an article, try asking the article author, in the forum provided under the article.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i want to fill a pdf form the problem is that the from is at URL i have to get that form and then i have to fill it. e.g if http://www.mypaperlessoffice.com/cura_grayed/test.pdf is the form URL now how i can fill it?
thanks
|
|
|
|
|
If it's a PDF, then you can't hope to fill it online, at all. You'd have to download it, manipulate it on the server end, and then hope the site offers some way to upload it again.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have a list of PDF files which are uploaded into the database. Now on way back I recieve bytes which I Flush to browser but it ether ask for open or save option or it display nothing. Please help in any VB.Net or C# . My Code is
response.clear
response.contenttype="application/pdf"
response.flush
//tried either of below but both doesnt work
response.writebytes (myFileBytes)
// OR after writing a file from bytes
response.writefile(Filepath)
Response.end
Any help or suggestion ?
Regards
|
|
|
|
|
Rizwan Bashir wrote: but both doesnt work
Meaning?
|
|
|
|
|
Meaning it does not display in browser which is my problem.
|
|
|
|
|
If write file doesn't work, then you have serious issues. What's actually happening ? Try losing the clear and flush calls, you don't need them.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks Christain
It works with Firefox but does not work with IE 6.0.2x version. Any solutions for IE6 ?
Thanks Alot
|
|
|
|
|
I can't imagine why it wouldn't work, although I would use Response.BinaryWrite. Try that.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Same Story.. works with Firefox and does not work with IE6.. but surprisingly I tested it on IE7 and it works fine. I really dont know what is going on. Where i try on web with different pdf's available online they open directly in the IE 6 but not mine.
Regards
|
|
|
|
|
i have a table emp.where the coloumns are
emp_id,emp name and address.
and onother table named as emp_details
where the coloumns are.
empid,emp_sex,emp_age,emp_bloodgroup.
now i am populating the data of emp in the gridview1 where "auto generate select button is true".
whenever i will select the record of any employee.the corresponding empid of that column should display in the "textbox2" show that
i can enter the other data for emp_details(where the other text boxes are there to enter age,sex and blood_ group).
canyou tellme what code i wil write for it(in vb.net)
|
|
|
|
|
Loop through the all the Items in datagrid and Set the onclick attribute to the link button of grid, and then call any procedure through Javascript, which assigns the value to textbox.
Code for settting onclick attribute to datagrid.
Dim LnkBtn As New System.Web.UI.WebControls.LinkButton
LnkBtn = datagrid1.Items(i).Cells(0).FindControl("lnkSelect")
LnkBtn.Attributes.Add("onclick", "Write the Javascript Code Or Call local Javascript Procedure")
Script for Setting value to TextBox.
document.all('textbox1').value = datagrid1.Item(RowId).cells(ColID).text>
Bhaskar Shetty
|
|
|
|
|
hi guyz
again i need ur help.
i have a table emp.where the coloumns are
emp_id,emp name and address.
i am storing the data to "emp" table from the frontend throgh storepocedure.there is a "check" button, in which i want to check the data from the database based up on the empid.
i want to check if there is any record based up on the empid from emp table.it should give a message that "one reocrd found" .
where i am entering the empid in the "textbox1.text".what will be code for it in "vb.net"
|
|
|
|
|
In Stored Procedure,
"SELECT COUNT(*) FROM emp WHERE emp_id = @empID
Use SqlCommand or OledbCommand to execute the stored procedure. Get the return value and show it to the user.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
are u taking about how to execute sp in dotnet.
here code in C#
setting = ConfigurationManager.ConnectionStrings["databaseConnectionString"];
if (setting != null)
{
conn = new SqlConnection(setting.ConnectionString);
cmd = new SqlCommand("Sp_Category_check");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@cateid", SqlDbType.VarChar);
cmd.Parameters["@cateid"].Value = DropDownList1.SelectedValue;
conn.Open();
cmd.Connection = conn;
try
{
rdr = cmd.ExecuteReader();
if (rdr.Read())
{
//here your message comes
}
}
catch (SqlException ex)
{
Response.Write(ex.ToString());
}
finally
{
if (rdr != null)
{
rdr.Close();
}
if (conn != null)
{
conn.Close();
}
}
imaran khan
|
|
|
|
|
Dear All,
I am trying to use the asp.net menu control in order to create a horizontal menu made up of images.
I have a table which has 3 columns and 1 row. the first cell is used to hold an image that does not have to do with the menu, the second cell holds a table that contains the menu while the third cell contains another independent image. All cellpadding and cellspacing and border are set to 0.
Now what is happening is that the menu cell is leaving a margin at the top of arount 1 or 2 pixels. All the images used in the row are the same height even the other images that do not have to do with the menu.
Everthing looks fine in mozilla! the problem is with IE
Anyone has ever encountered this?
Thanks a lot,
Chris Farrugia
|
|
|
|
|
Hi All,
Could anyone please help me out in auto-generating a property in a class in a following format:
public System.Int64 RollNumber
{
get
{
System.Int64 rollNo = (System.Int64 )this["@roll_number"];
return rollNo;
}
}
I am able to generate the property with the return statement and the other stuff, but i am not able to Generate the assignment statement i,e :
System.Int64 rollNo = (System.Int64 )this["@roll_number"];
Please Help.
Thanks,
Ramesh
|
|
|
|
|
I have created a user control that contains All Fields Like Address textbax
City Text box , State drop down ,zip code Textbox
Now State Drop downlist is another user control(different dll) that i am using into that
Now problem i am getting that on first page the drop down is prepopulating the All the list of states but after that is not can anyone tell What might be reasone ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|