|
I am woring on a scheduler application in asp.net with c#.
in this application i have to show popup on scheduled time and date.
scheduled time and date store in sql server table and popup contains.
can any one help me how can i open popup on specified date and time.
thanks
|
|
|
|
|
through window service u can do it. But will not be web application.
because to open the pop up the application should be in running state.
and we can not ensure a web application is in running state.
for this u can put the timer in your application.
pick the time from database.
then calculate the time span with system Time.
and Initialize the timer Tick property.
start the timer.
and pop up the window on Timer_tick Event.
|
|
|
|
|
Hi
It would be great if you can send across the sample code. This will help me a lot. I am new to this and hence your help would be grealty appreciated.
Thanks in advance.
Awaiting for a positive response from you.
|
|
|
|
|
Hi,
I am working in ASP.Net and I want to export data from an Excel file to the MySQL. In SQL SERVER 2005, I use SQLBULKCOPY for doing the same. Is there any alternative of doing the same for mySQL also.
Thanks is Advance,
|
|
|
|
|
Read Records one by one from the sheet and insert it into the desired table. the below function will help you in returning table from the Excel Sheet but the sheet name should be Sheet1. if change ..then change the code i have highlighted with underline(bold)
public DataTable getDataFromXLS(string strFilePath)
{
try
{
string strConnectionString = string.Empty;
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + strFilePath + ";" + "Extended Properties=Excel 8.0;";
OleDbConnection cnCSV = new OleDbConnection(strConnectionString);
cnCSV.Open();
OleDbCommand cmdSelect = new OleDbCommand(@"SELECT * FROM [Sheet1$]", cnCSV);
OleDbDataAdapter daCSV = new OleDbDataAdapter();
daCSV.SelectCommand = cmdSelect;
DataTable dtCSV = new DataTable();
daCSV.Fill(dtCSV);
cnCSV.Close();
daCSV = null;
return dtCSV;
}
catch (Exception ex)
{
return null;
}
finally { }
}
|
|
|
|
|
I have a text box and a set of checkboxes in my form. The textbox is dynamically created.
There is a postback event on the textbox as OnTextChangedEvent and I am checking for a condition in the database with the text entered in textbox.
The issue is whenever the OnTextChangedEvent fires and if the user checks any of the checkboxes, the checkbox is getting cleared. Obviously, this is the nature of web application.
I want to know, whether there is any way to preserve the checked state of checkbox even after postback. I couldn't use the updatepanel because it is dynamically created textbox. I'm just using a placeholder for that. I don't want to place a button next to that. Because then, I need to track whether the user has to click the button etc.
Is there anyway to put the code only in textchange event and keep the changes in other controls without using the update panel?
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
I m creating textboxes dynamically.....depends on users choice. now i want to store the value of dynamically created textboxes in database. i used FindControl, but its storing with blank...please give me an example................Thankyou
|
|
|
|
|
can you plz send the code
|
|
|
|
|
Dim id As Integer = Request.QueryString("ui")
Dim cmd2 As String = ("Select Specification from DefineSpecification where CategoryID=" + ID.ToString())
Dim rdr2 As IDataReader = db.ExecuteReader(CommandType.Text, cmd2)
Dim conn As New SqlConnection
Dim cmd As New SqlCommand("Select Count(*) from DefineSpecification Where CategoryID=" + ID.ToString(), conn)
conn.ConnectionString = ConfigurationManager.ConnectionStrings("See2Buy").ConnectionString
conn.Open()
Dim count As Int32 = Convert.ToInt32(cmd.ExecuteScalar())
While rdr2.Read
Dim lbl = New Label()
lbl.Width = "140"
lbl.Text = rdr2.Item("Specification")
for(counter2 as integer=0 to count)
Dim txt As TextBox = DirectCast(FindControl("TextBoxID1"), TextBox)
Dim str As String = DirectCast(txt.Parent.FindControl("hfValue"), HiddenField).Value
Dim cmd3 As String = "Insert into Specification(SpecificationHeading,SpecificationDescription)Values('" + lbl.Text + "','" + str + "')"
Dim dbcmd As DbCommand = db.GetSqlStringCommand(cmd3)
db.ExecuteNonQuery(dbcmd)
End While
|
|
|
|
|
Are you generating textboxes inside gridview control OR in table.?
if you are using the gridview find the control by ControlType
if the control is textbox then get its text.
foreach (GridViewRow row in grdName.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
foreach (Control ctrl in row.Controls)
{
if (ctrl is TextBox)
{
TextBox txt = (TextBox)ctrl;
string str = txt.Text;
}
}
}
}
Get the text as above.
|
|
|
|
|
I m generating textboxes in the panel
|
|
|
|
|
i have tried the below code and i am getting the text from the text box.
i have generated the Textboxes in page_Load
and accessed the textbox text on button_Click
<table>
<tr>
<td colspan="2">
<asp:Panel ID="Panel1" runat="server" Height="200px" Width="125px">
</asp:Panel>
</td>
</tr>
<tr>
<td style="width: 100px">
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></td>
<td style="width: 100px">
</td>
</tr>
</table>
Code.
protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i < 4; i++)
{
TextBox t = new TextBox();
t.Width = Unit.Pixel(160);
t.Height = Unit.Pixel(22);
Panel1.Controls.Add(t);
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string str = "";
foreach (Control ctrl in Panel1.Controls)
{
if (ctrl is TextBox)
{
TextBox t = (TextBox)ctrl;
str = t.Text;
}
}
}
i am getting the text i entered in the textboxes. In your case implement it as you required.
|
|
|
|
|
|
Did you deployed your site properly ? What is the .NET Framework version set in IIS ?
|
|
|
|
|
I develop this website using VS.net 2008, I does not put it on wwwroot or using IIS folder
modified on Wednesday, July 8, 2009 3:02 AM
|
|
|
|
|
Do you have any idea , How to Create Excel File and Adding multiple Tabs init without adding Reference of Microsoft.Office.Interop.Excel in our web application?
Is there another way to do the same thing without adding DLL reference?
|
|
|
|
|
hi,
Im trying to read word document located at client machine in asp.net 1.1
can anybody help!
thanks in advance!
|
|
|
|
|
Spurple wrote: Im trying to read word document located at client machine in asp.net 1.1
You can't!
|
|
|
|
|
Spurple wrote: Im trying to read word document located at client machine in asp.net 1.1
Java Script does not have the sufficient right to do this.
Probably ActiveX can be a alternative solution. But it will work only on IE
|
|
|
|
|
hi,
I have a dynamically created control by javascript.I have to use the value of the control.so I have to pass the value from javascript to c#.How can I do this?
reagards
Bill
|
|
|
|
|
Hi
Put the value of your control in hidden field and use it in c# code.
himanshu
|
|
|
|
|
hi..
in my page n number of fields are there.user may enter some fields maynot enter some fields.so i am not using required field validator.I just want to check with valuetype.so i am using regular expression validator for name to allow lower & upper case letters and space,' etc.see code below.
i am entering only those letters only eventhough error message is coming.why??<br />
<td align="left"> <asp:TextBox ID="fname" runat="server" ToolTip="First Name" MaxLength="15" CssClass="textbox" /></td><br />
<br />
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" SetFocusOnError="true" Display="Dynamic"<br />
ControlToValidate="fname" ValidationExpression="[a-zA-Z''-'\s]" ErrorMessage="invalid entry"></asp:RegularExpressionValidator>
|
|
|
|
|
Your regular expression probably demands a value. You need to create a regular expression that will pass on an empty input as well as any valid filled in input.
|
|
|
|
|
There is a property on these validators, it's something like 'validateifempty'. I forget the name, but I think that's what you need.
Oh, it looks to me like your regex is for only one character. I think you need a * after it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hey thanx..its working after adding * to my expression..i did basic mistake..
|
|
|
|