|
I need to transfer context information from ASP to ASP.Net. My boss told me not to do through Querystring....Please suggest some other secured alternatives.?
|
|
|
|
|
Try using the Session Object, you can set up what ever context variables while in the ASP application, and when you get to the ASP.Net application get those variables from the session.
Greets! Joel
|
|
|
|
|
ASP and ASP.net use different session access...
|
|
|
|
|
But both would be on different boxes?
|
|
|
|
|
If you can't use the query string, then your only real option is to do something fancy. There are solutions around on the web for moving session data between asp and asp.net. Typically, they use a unique Id gleaned from the client to store data in a windows service and pull it out on the other end.
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 )
|
|
|
|
|
Hi,
I am creating report which having logo of my company on each report.
When I work on local computer report display logo properly,same when I move reports to testing computer it still not showing any problem,but when I moved same code and reports on client computer it shows black instead of logo image.
Is there any IIS or crystal report settings need to be done....If u have any idea please share with me....
Thanks,
Nagraj
|
|
|
|
|
Good morning experts,
How can I get the total number of rows in a gridview that has paging and a filter.
ex.
dw.RowFilter = strFilter 'dw is a dataview
GridView1.DataSource = dw
GridView1.DataBind()
gridview1.Rows.Count gives me the number of records in the current page
dw.Table.Rows.Count gives me the number of all records ignoring the filter.
Thanks
|
|
|
|
|
Use dw.Count instead of dw.Table.Rows.Count
when you use the Table property of the dw DataView you're referencing the original table and not the DataView itself
Greets! Joel
|
|
|
|
|
|
No problem
Greets! Joel
|
|
|
|
|
HI
I am having problems with the below code, it creates a user within my usertable, and validates that passwords match, but i can't get it to provide the user with a confirmation page this is the code I have.
I get the error message error executing child request for userHome
Sub send_loginCreds(ByVal sender As Object, ByVal e As EventArgs)
Dim litErr As New LiteralControl
'Create connection string to pass database, string holds login information to mySQL,
Dim connectionString As String
connectionString = "Server=localhost; uid=; pwd=o;database=ftp1;"
'Builds .net mysql connection and passes connection string into method
Dim connection As New MySqlConnection(connectionString)
'Create mySql command string for passing query or SPROC(Stored Procedure)
Dim cmdString As New MySqlCommand
'Set Command to equal mySql connection,t so can pass SQL query
cmdString.Connection = connection
Try
'Set command string to equal SPROC
cmdString.CommandText = "sp_myInsertusers"
'ONLY PLACE THIS IF SPROC, sets the command to a SPROC
cmdString.CommandType = CommandType.StoredProcedure
Dim param As New MySqlParameter
param = cmdString.Parameters.Add("?p_username", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtFirstName.Text
param = cmdString.Parameters.Add("?p_password", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtPassword.Text
param = cmdString.Parameters.Add("?p_firstname", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtFirstName.Text
param = cmdString.Parameters.Add("?p_lastname", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtLastName.Text
param = cmdString.Parameters.Add("?p_phone", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtPhone.Text
param = cmdString.Parameters.Add("?p_mail", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtMail.Text
'Executes stored procedure
connection.Open()
cmdString.ExecuteNonQuery()
connection.Close()
Server.Transfer("userHome")
Catch ex As Exception
'Returns error message
litErr.Text = ex.Message
MsgBox(ex.Message)
End Try
|
|
|
|
|
Is userHome an *.aspx page, try using
Server.Transfer("userHome.aspx")
One advice(not related to your problem but related to your code) is to leave your connection string in the web.config and accessing it from there, that way you don't have to have the connection string in every single DB access method
Greets! Joel
|
|
|
|
|
me stupid
cheers joel
|
|
|
|
|
The basic purpose:
I code the Form for changing Profile Properties.
The basic Problem:
When i change web.config (adding or removing new Properties)
how to make changes to Form what i write.
Tried to use ObjectDataSource but there the delirium turned out...
Now as though I write Buisness Class which thought to connect to ObjectDataSource and to change through FormView.
But I do not know how many properties it profile and I can not to everyone make Class properties. Pleace help... Throw ideas as it
|
|
|
|
|
I am really confused with this issue. I have a datagrid where I am creating columns dynamically. Everything gone fine till page posts back. It failed to maintain the state of the grid. I tried with enabling view state for the grid, but no use! What is happening ? Is ASP.NET having any problem on keeping the data for dynamically created columns ?
|
|
|
|
|
Yeah. That's why we used to do like that
Page_load(){<br />
if(!IsPostBack){<br />
DataSet ds = Database.GetDataMethod();<br />
datagrid.DataSource = ds.Table[0];<br />
datagrid.DataBind();<br />
Cache["mydata"] = ds.Table[0];<br />
}<br />
else{<br />
datagrid.DataSource = Cache["mydata"];<br />
datagrid.DataBind(); <br />
}<br />
}
|
|
|
|
|
Thanks for your suggestion Michael, But assume that I have some textboxes in these dynamically created columns. I won't be able to access the textbox value because of this problem. Your code caches the datatable and binds it again, but what about the values changed in text boxes ? I think I won't be able to get it
|
|
|
|
|
Yeah. I think so.. One way I can think of is that you hav to save those values in somewhere (eg: cache) before postback and set it back accordingly onload. it's not flexible solution....
|
|
|
|
|
Michael Sync wrote: I can think of is that you hav to save those values in somewhere (eg: cache) before postback and set it back accordingly
That is fine. But what will happen if I change the control value before posting back ? This method will assign previous value to the controls.. I think this is a bug in ASP.NET. What do you think ?
|
|
|
|
|
Why create dynamic columns?
You can use template columns and create a template containing multiple web server controls to manage the the dynamic presentation of content which will have their state maintained, and can also utilise the RowDataBound event to manipulate row level content if you have a need to go that far.
Rhys
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."
Terry Pratchett
|
|
|
|
|
Rhys666 wrote: You can use template columns and create a template containing multiple web server controls to manage the the dynamic presentation of content which will have their state maintained,
Thanks, But I won't be able to do this, because I can't predefine the number of columns that I have on the grid. So how do I implement this method. One question, If I place a contentplaceholder inside template columns or added controls dynamically to the template columns, will it maintain the state ?
|
|
|
|
|
Navaneeth. wrote: Thanks, But I won't be able to do this, because I can't predefine the number of columns that I have on the grid
Why? I've got to be honest and say I can't really see where you're trying to go with this, as a developer surely you know have some awareness of the base objects you're dealing with. It just appears you're trying to be too generic in your approach and it'll probably mean more work and far less re-usability in the long run. Can you explain why you need an almost entirely dynamic DataGrid/GridView?
I'd assume that as per dynamic controls on a page what you need to do is recreate your dynamic columns and their controls on every postback and if that doesn't work, what you're attempting probably isn't supported.
Rhys
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."
Terry Pratchett
|
|
|
|
|
Hi,
i know the month .
From this how i find the number of days in that month
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
DateTime.DaysInMonth ?
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 got it..
int iNoDay=System.DateTime.DaysInMonth(EntTransactionDate.Year, EntTransactionDate.Month);
thank u
All I ever wanted is what others have.... CrazySanker
|
|
|
|