|
Actually, the dynamic control can persist data in the ViewState as the static control does. The important thing when working with the dynamic control is that you need to choose the right event to readd the dynamic controls. If this happens after the ViewState is loaded, then it will loose its ViewState data. For more information, you should read about the control life cycle in MSDN.
|
|
|
|
|
if you want to see the selected value each time, it is easy...
give it an ID, say idListBox.
while creating it, get the value from form variables to determine the selected value:
...
selVal = request.forms("idListBox")
loop
create a list item
if value of the item = selVal then add "selected" to the item
add item
end loop
...
That's it...
HainKurt
|
|
|
|
|
hi all
i have a string in dd/mm/yyyy (e.g 26/06/2006) i wants to insert in database as datetime format. the data type in database is DataTime.
pls send the syntex.
thankX
Regards,
Srinandan Mall
|
|
|
|
|
First parse the string into a DateTime value:
DateTime theDate = DateTime.ParseExact(theString, "dd/MM/yyyy", CultureInfo.InvariantCulture);
Then you can use the DateTime value in the call to the database.
---
b { font-weight: normal; }
|
|
|
|
|
Hi All,
when i want to create ASP.NET Web service i get this error
"Visual Studio not identify the version of ASP.NET on the Web server.The Web server reported the
following error when attempting to create or open the Web project located at the following
URL:'httpL//localhost/WebService1'.HTTP/1.1 401 Access Denied'.
Do you want to continue?
Yes No Help
if i click yes then i get one window Web Access Failed with three options
Retry using a different file share path
Location
Try to open the project with FrontPage server Extensions
Work offline
but in the end i cant created.
How to solve this problem?
Thanks
whitesky
|
|
|
|
|
Hi all,
I would like to create an online stock exchange trading software in ASP.Net, c# and sql server 2000 for a consultant company to display pricing list. I would like to know how can i get the online pricing list of NSE [National Stock Exchange], BSE [Bombay Stock Exchange] and Commodities Exchange.
Thanks
Naresh Kumar
|
|
|
|
|
The same i m looking for. If u get any help plz let me know the same. For more information u can add catchme_matrix@yahoo.com for yahoo messanger. Thanks
|
|
|
|
|
I want to use dropdown list in the datagrid pls tell me how to do this.
|
|
|
|
|
|
|
Dear Friends,
How can i Create Excel File in ASP.NET 2.0(2005). I want to give all the Excel sheet functionality through ASP.NET Coding . Please help me for this Solution.....................
Haridas.R
harisofttech@hotmail.com
"Achievement is not a destination, its a journey "
|
|
|
|
|
Well it is very simple to create excel files from asp.net code.
The following is the sample code to create one with font and style settings etc.
----------------------------------------------------------------------
//Write a table structure with all formatting you need (e.g. font, etc.)
string strHtml="
strHtml+= ""
strHtml+=""
strHtml+=""
strHtml+="Name | Color | Formatting | Ketan | This is Red Color Font | None | Abc | NA | None | Xyz | NA | This is bold text | "
//Clear the Response Headers
Response.Clear();
Response.Charset = String.Empty; // String.Empty();
//Set Content Type and add header
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment; filename=abc.xls;");
this.EnableViewState = false;
System.IO.StringWriter myTextWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter myHtmlTextWriter = new System.Web.UI.HtmlTextWriter(myTextWriter);
HtmlGenericControl gn = new HtmlGenericControl();
gn.InnerHtml=strHtml;
gn.RenderControl( myHtmlTextWriter);
Response.Write(myTextWriter.ToString());
Response.End();
----------------------------------------------------------------------
If you need to embed excel sheet functionality, you need to work out more.
Regards,
Ketan Majumdar.
|
|
|
|
|
Thank you Mr.Ketan Majumdar.
Haridas.R
harisofttech@hotmail.com
"Achievement is not a destination, its a journey "
|
|
|
|
|
There are a couple of ways to create the Excel document:
+ Use the Automation to create the Excel file, however this option is not recommended at the server side.
+ Create the Excel file in XML format.
+ Use a third party component to generate the Excel file without using Automation.
|
|
|
|
|
hello
as u know asp.net have different controls i want to make
datagrid as webcontrol which is use in every web forms
can u suggest me some idea for this?
|
|
|
|
|
Just follow the instructions given below
First of all,take datagrid from toolbox and paste it on webform1.aspx
1) Now Use some database to connect to table. Use its connection string.
e.g. Dim con as new sqlconnection
con.ConnectionString="Data Source=servername;Initial Catalog=pubs;User Id=sa;Password=sa;Persist Security Info=False;";
2) dim ds as dataset()
dim cmd as sqlcommand = new SqlCommand()
cmd.Connection=cn
Dim Query As String = "select * from EET_ACCRIGHTS"
'use above code for ref.
Dim MyCommand As SqlDataAdapter
MyCommand = New SqlDataAdapter(Query, con)
DS = New DataSet
MyCommand.Fill(DS, tablename)
3) Now use following code
If con.State = ConnectionState.close Then
con.Open()
End If
datagrid1.datasource=ds.tables(0)
datagrid1.databind()
If con.State = ConnectionState.Open Then
con.Close()
End If
Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
|
|
|
|
|
Hello All,
I created a bit map and it is saved to a jpg file. The code is:-
oBitmap.Save("c:\\codes\\gen_img.jpg", ImageFormat.Jpeg);
I want the file to be given by the user(save dialogbox should come and the filename should be given by the user and the location "SHOULD BE" on the server),i.e, i need to get the location as well as the filename from the dialog box and should be given instead of the hard-coded one.
Hope Anyone can find me a Solution for this!
regards,
jeeva
|
|
|
|
|
If you mean that the user should upload the file:
Put a FileUpload control in the form. When the file has been uploaded you get it from the PostedFile property of the control.
If you mean that the user should get a dialog to choose a location on the server:
You have to build the dialog yourself in the form of a web page. There is no way that the user can directly access the file system of the server.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks For The Help!!!!!!!!!!!!!!!;)
|
|
|
|
|
How to find how many years,months,dates in two different dates
format dd/mm/yyyy
eg 01/06/2001 to 11/06/2006
ouput:5 years,0months,10 days
parthiban
|
|
|
|
|
in C#?
DateTime dt1 = new DateTime(2001,6,1);<br />
DateTime dt2 = new DateTime(2006,6,11);<br />
<br />
TimeSpan ts = dt2.Subtract(dt1);
The TimeSpan class has propertiessuch as "TotalDays" which will give you the info you want.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
hi ,
you can use SQL also to find the difference between two dates.
the code looks like :
DATEDIFF(part of the date,start date,end date)
"part of the date" means whether its day,month or year of a date variable.
Tirthadip
Live life to the fullest
|
|
|
|
|
Hello Everybody,
I need help from all of u, pls help me for following code.
I have given number for each line, only for ref. When u copy the code, pls remove the numbers given and do modification.
The original code is in C# that converted into VB.net using converter.This code is perfectly working in C# without any error and waring Now I'm facing problem.
Now problem is, the line number 20 need raiseEvent, I don't know how to raise event in vb.net
Pls concentrate on line 20. Pls let me know how to declare and raise event.
1 Public Class CreateItemTemplateRadioButton
2 Implements ITemplate
3 Dim strText As String
4 Dim strRadioButtonName As String
5 Dim Visibility As Boolean = True
6 Dim blChecked As Boolean = False
7 Public Sub New(ByVal RadioButtonName As String, ByVal Text As String, ByVal AutoCheck As Boolean)
8 Me.strText = Text
9 Me.strRadioButtonName = RadioButtonName
10 Me.blChecked = AutoCheck
11 End Sub
12 Public Sub New(ByVal RadioButtonName As String, ByVal Text As String, ByVal AutoCheck As Boolean, ByVal Visibility As Boolean)
13 Me.strText = Text
14 Me.strRadioButtonName = RadioButtonName
15 Me.Visibility = Visibility
16 Me.blChecked = AutoCheck
17 End Sub
18 Public Sub InstantiateIn(ByVal objcontainer As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn
19 Dim rad As HtmlInputRadioButton = New HtmlInputRadioButton
20 rad.DataBinding += New EventHandler(rad_DataBinding)
21 objContainer.Controls.Add(rad)
22 End Sub
23 Private Sub rad_DataBinding(ByVal sender As Object, ByVal e As EventArgs)
24 Dim rad As HtmlInputRadioButton = CType(sender, HtmlInputRadioButton)
25 rad.Value = strText
26 rad.Checked = blChecked
27 rad.Visible = Visibility
28 End Sub
29 End Class
Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
|
|
|
|
|
|
Thanks for ur help,
I have tried for the whole day, finally I got answer from my collegue last evening.
So now its working fine. Thanks for also ur help.
Keep in touch
Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
|
|
|
|