|
Exactly the same way, except that you use a different content type.
---
single minded; short sighted; long gone;
|
|
|
|
|
What about the format of the file, how do I get the format of the displayed file to be the same as the original file? Thanks
|
|
|
|
|
Hello!
I have this sql statement below:
Dim strSQL As String = "SELECT EmailAdd from vwDepList where Member_ID =' " & dropAssigned.SelectedValue & "'"
I want that my lblEmailAdd.text will refelect the value of strSQL depending on the dropAssigned.SelectedValue.
Need a tutorial. Thanks.
|
|
|
|
|
I am C# guy so I will write in C#. You can translate it into VB.NET
lblEmailAdd.text = GetEmail(dropAssigned.SelectedValue)
private String GetEmail(String memberID)
{
SqlCommand command = _Connection.CreateCommand();
String SQL = String.Format("SELECT EmailAdd from vwDepList where Member_ID
= '{}'",memberID );
command.CommandText = SQL;
command.CommandType = CommandType.Text;
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = command;
DataTable table = new DataTable()
adapter.Fill(table);
string email = (string)table.Rows[0];
return email.
}
Above _Connection is the SqlConnection to database.
Hope that helps.
|
|
|
|
|
hai everyone
i want to add activexobject("WScript.Shell") in my aspx page
plz tel me step by step
thanks
Dhatchinamoorthy.R
9894824838
|
|
|
|
|
Do you want to run this object on the server, or the client ? If the server, why ? If the client, it has nothing to do with ASP.NET, you need to do it using javascript, if that's possible. It doesn't seem likely to me.
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 GetData methd which is returning a table using
> sqldataadapter. I bound that datasource with GridView but now I want
> to invisible Gridview's first column but it gives me following error
> although I have 5 columns in my datatable.
> Index was out of range. Must be non-negative and less than the size of
> the collection.
> Parameter name: index
> GridView1.DataSource = GetData();
> GridView1.DataBind();
> GridView1.Columns[1].Visible = false;
> Thanks for help me in advance
seema
|
|
|
|
|
Hi,
When you add grid view, to bind it to datasource, the best practice is below:
Click on the property builder (the little black arrow comes up when you click on GridView):
-->Add New Column:
-->Choose field type = bound Field
-->HeaderText = your choice
-->DataField = "The name of the column in your datatable.
Now go to GridView property:
AutogenerateColumns = False
Doing the above you won't have to hide any columns, you will see what you have decided. If you are worrying about the primary key, set that in the "DataKeysNames":
DaatKeysnames = (ColumnName from your DataTable) "PrimaryKeyColumnName"
Hope that will solve your problem.
Cheers.
|
|
|
|
|
Sir greetings again...
i appreciate everyones kindness..
and again i need your help..
i have this issue on setting or getting/displaying the client date time. coz everytime i access my sample application which i stored from the server, it fires me the server date and time settings...
my question is, how to set/get/display the client date and time instead of the server time?
anyone can help, and anybody's help and kindness is highly appreciated....
thank you and more power to us guyz......
start a new beginning in every ending; thats what life for......
|
|
|
|
|
I don't think it's possible, unless you're somehow able to work out their timezone ( using geoip ) and work out the time from there ( which may not be the time their PC is showing ). This is why most web sites ask you what timezone you are in, because they can't work it out for themselves.
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 )
|
|
|
|
|
Use Javascript to get the client time:
vad d = new Date();
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi
i'd like to know how can i get fields values of DetailsView control.
I don wanna write connection, command,... codes
i like to put 1 sqlDataSource and DetailsView on my page to look for a record
then put the data to some labels around my page by getting DetailsView's fields values.
Thank you
|
|
|
|
|
found it!
in GridView it's like this:
grvExpenditure.Rows[index].Cells[ColumnIndex].Text
|
|
|
|
|
I have an aspx page in a project that was recently converted from VS 2003 to VS 2005. The page contains a UserControl which is located w/in the same application. Here's the file structure:
/includes/parent1/parent2/EditProfile.aspx
/includes/utils/StateDropDown.ascx
And I am getting the following error message from the VS compiler (not from the web because I can't compile the site): The virtual path '/includes/utils/StateDropDown.ascx' maps to another application, which is not allowed.
The project is file based, not http or ftp and there are no virtual directories in the project, so all directories w/in the project are in the same application. Why am I getting this error, and how can I fix it? Please help!
I've looked all over the web and all the related topics seem to relate to dynamically loading UserControls. The UserControl in question is added to the ASPX page using:
<br />
<%@ Register TagPrefix="uc1" TagName="StateDropDown" Src="/includes/utils/StateDropDown.ascs" %><br />
Thanks,
Mark
-- modified at 17:37 Thursday 21st June, 2007
|
|
|
|
|
Put a ~ at the front of the path, this maps to your application root. Or, use a relative path.
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 GetData methd which is returning a table using sqldataadapter. I bound that datasource with GridView but now I want to invisible Gridview's first column but it gives me following error although I have 5 columns in my datatable.
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
GridView1.DataSource = GetData();
GridView1.DataBind();
GridView1.Columns[1].Visible = false;
Thanks for help me in advance
seema
|
|
|
|
|
You must have called the code for making it "visible=false" before the gridview being bound to the datasource
put if(gridview1.rows.coun>0)
{
control.visible=false;
}
It should work.
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
What's wrong in the following statement.
if ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&& (Convert.ToInt32(e.Row.Cells[2].Text)>=17))
seema
|
|
|
|
|
seemamltn wrote: ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&
You have an extra bracket, it is suppose to be if ((Convert.ToInt32(e.Row.Cells[2].Text) >= 15) && (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
|
|
|
|
|
The syntax error comes from mismatching parentheses.
What's really wrong about the statement, is that if the value is >= 17, then it always is >= 15, so half of the code is totally superfluos.
if (Convert.ToInt32(e.Row.Cells[2].Text) >= 17)
---
single minded; short sighted; long gone;
|
|
|
|
|
I have a date
startdate = '6/20/2007 11:21 AM'
enddate = Datetime.now
I want to calculate the difference betewwn enddate-startdate and then convert it into hours.
How can I do that in asp.net
Thanks
seema
|
|
|
|
|
TimeSpan ts = DateTime.Now.Subtract(DateTime.Parse("6/20/2007 11:21 AM"));
string strTimeDiff = ts.TotalHours.ToString();
|
|
|
|
|
I have a web form which has some radiobuttons in it. it looks like this:
asp:RadioButton ID="RadioButton1" runat="server" AutoPostBack="True" Checked="True" GroupName="aa" Text="r1"
asp:RadioButton ID="RadioButton2" runat="server" AutoPostBack="True" GroupName="aa" Text="r2"
asp:RadioButton ID="RadioButton3" runat="server" AutoPostBack="True" GroupName="aa" Text="r3"
asp:Label ID="Label1" runat="server"
in the vb file,
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Me.RadioButton1.Checked Then
Me.Label1.Text = "r1 is selected"
ElseIf Me.RadioButton2.Checked Then
Me.Label1.Text = "r2 is selected"
ElseIf Me.RadioButton3.Checked Then
Me.Label1.Text = "r3 is selected"
End If
End Sub
when the page is loaded, r1 is selected, then I click r2 and r3, then click BACK button in Internet explorer, the label text changed correctly, but not radiobutton selection. Can anybody explain it? and is there anyway to fix this?
thanks,
|
|
|
|
|
So let's say I have a Search textbox on a page and a login textbox on a page. When I hit the enter key on the keyboard I want it to fire the login button click event when the cursor is in the login textbox and fire the search button click event when the cursor is in the search textbox.
How does one handle that? I found some vague references in google about using javascript for this, but is there any C# asp.net native ways of doing this?
If js is the only way can someone post an example or a good url of where this is covered?
Thank you
|
|
|
|
|
u have to capture the key press event and you have to check the condition whether enter is pressed or not if pressed you have to dopostback on the control you want following the is the example to capture event.
in you aspx page under the for tag place your text box
<asp:textbox id="textBoxName" runat="server">
in page load event write the following code
If Not Me.IsPostBack() Then
textBoxName.Attributes.Add("onKeyDown", "javascript:checkEvent();")
End If
in your aspx page under the HEAD tag write the following javascript code
function checkEvent()
{
alert(window.event.keyCode);
if (window.event.keyCode==13)
{
__doPostBack("controlname",""); //please check the code i used to do like this only make sure view state of your control is true this is code i have used and it is working fone for me
}
}
Thanks
Warm Regards
Prakash-B
|
|
|
|