|
hi all
I have 3 frame in page asp.net
When i debug the frame ifmap run fist in and run to in page_load in map.aspx
How can i set frame ifmap2 run fist so dont change position iframe ???
|
|
|
|
|
This is a bit of a hack, but...
page_Init will run before page_Load. So if you do your stuff for ifmap2 in its page_init and your stuff for ifmap in its page_Load the order will be as you have requested.
|
|
|
|
|
Hi,
I'm making a website in ASP.NET (C#) that handles users. How do I store data specific to the user's connection. I got it working using static variables, but it turns out that all users have the same values for static variables (which makes sense now that I think about it).
How can I "remember" the user id of someone who logged in and not have it mix up other users? I know I could do it by using a static hashtable of userids and ipaddresses but I feel like this is probably a more complicated solution than it needs to be.
I know this is probably a pretty common question, and I'm sorry if its been asked before. Any response would be helpful though. Thanks,
|
|
|
|
|
Most people do not have static IP addresses. You would expect to have a database of usernames and passwords and then store who is logged in, in the session.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanks christian. the word 'session' was what i was looking for. I appreciate it...thanks a lot man,
-ken
|
|
|
|
|
I am just working with ASP.NET 2.0 and started first chapter Online Diary project. The first page contains asp:CreateUserWizard control. For some reasons it does not work properly. So I created my own test website and add that control. It is the same result. I entered more than 7 characters with at-least on numerical character but I get the same reply “Password length minimum: 7. Non-alphanumeric characters required: 1.”. Does someone know what is going on? If I want to test the password with database how can I retrieve the password? How to remove some of the controls from wizard? Your help will be very much appreciated.
|
|
|
|
|
i am trying to export a excel file to the user when they click a button, i tried Response.WriteFile("filename"), it only display the content in the same page, can someone tell me whats the code to prompt them with a save as option? Thank you in advance.
|
|
|
|
|
You need to set the content type to be application/zip and then it will come back as a download.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Another way is to add the file in header of the response
<br />
tring filename = "YourFileName.xls";<br />
<br />
if (filename != "")<br />
{<br />
<br />
string path = Server.MapPath(filename);<br />
<br />
System.IO.FileInfo file = new System.IO.FileInfo(path);<br />
<br />
if (file.Exists)<br />
{<br />
<br />
Response.Clear();<br />
<br />
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);<br />
<br />
Response.AddHeader("Content-Length", file.Length.ToString());<br />
<br />
Response.ContentType = "application/octet-stream";<br />
<br />
Response.WriteFile(file.FullName);<br />
<br />
Response.End();<br />
<br />
}<br />
<br />
else<br />
{<br />
<br />
Response.Write("This file does not exist.");<br />
<br />
}<br />
<br />
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... "
|
|
|
|
|
I have a gridview with two template fields and two data bound fields.
The two template fields are a checkbox and a textbox. My problem is I only want the textbox visible when the checkbox is checked.
I have been trying to do this with C# in code behind--but I am off to a bad start, this is new to me. Thanks in advance for any help.
My aspx code for the gridview columns is:
<Columns>
<asp:TemplateField HeaderText="Select">
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="PSO" HeaderText="PSO" SortExpression="PSO" />
<asp:BoundField DataField="PSO_id" HeaderText="PSO_id" InsertVisible="False" ReadOnly="True"
SortExpression="PSO_id" />
<asp:TemplateField HeaderText="Percent">
<ItemTemplate>
<asp:TextBox ID="percentEntered" Width="40px" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
|
|
|
|
|
i have sucessfully created a login system that enables users to register and login using visual studion 2005. It works fautlessly on the local machine. However when i run it remotely i get an error. the details of the error are not displayed to me. It is obviously a problem with IIS configuration???? can anyone help please.
|
|
|
|
|
how can i create nested grid
wasim khan
|
|
|
|
|
|
Hi u can do nested grid using template column...,
in that template column u can asign one more grid...,
Thanks & Regards,
Mageshh,
please don't forget to vote on the post
|
|
|
|
|
Nested grid
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Not sure if this is the right place exactly, but here goes...
We've coded up a component in the form of a .Net user control, embedded into IE. The control itself is to do with updating some stuff on the client machine.
During development, I managed to set up code groups etc using the Framework 2.0 config tool (which uses Caspol.exe behind the scenes). Basically, I set up a child group to the Local Intranet group under the Machine node, and alles ist gut at they say in Hamburg
Can you guess what's next? Precisely - moved to an external webserver, and despite setting up the codee groups "correctly", I'm not getting the control rendered to the page.
I've tried several approaches - Child group of the Internet zone, Top level group itself, Machine level, User level etc, but can't seem to find any combination of settings that works from the internet (Tried URL evidence and strong name evidence)
Anyone been able to set something like this up in the past, and if so, how the funk did you manage it hehe?
C# has already designed away most of the tedium of C++.
|
|
|
|
|
I have a small problem that i can't figure out:
I have a for loop that looks something like the:
for i=0 to rs.rows.count - 1
sqlstring = "Select * From [User] Where Age=" & i &"
rs2.open sqlstring, conn
for each x in rs2
Height = Height + rs.rows(x).items("Height")
next
'This is the part i'm having now i need to divide the height by the total number of rows this will hopefully give me the average height for people in that age group. This will then be inserted into a new Table with all the average heights.
Next
If anyone can see where I'm going wrong please can you help. Any advice is most appreciated.
|
|
|
|
|
Oh god, you couldnt do this a worse way if you tried!
if you have a table called users with columns
<br />
Age INT<br />
Height FLOAT<br />
and you want to know the average height of 10 year old users you can do this with one query:
select AVG(Height) AS AverageHeight from Users WHERE Age=10
|
|
|
|
|
This is exactly the code:
Dim oR1, SQL1
Dim oR2, SQL2
Dim XML
Set oR1 = Server.CreateObject("ADODB.Recordset")
Set oR2 = Server.CreateObject("ADODB.Recordset")
XML = "<graph caption="Output report" subcaption="By Quantity" decimalprecision="0" xaxisname="Age" yaxisname=" Height">"
SQL1 = "Select * From [User]"
Set oR1 = oConn.Execute(SQL1)
For i=1 to 100
SQL2 = "select AVG(Height) As AVGHeight, Age from [User] Where Age=" & i & "Group By Age"
Set oR2 = oConn.Execute(SQL2)
While Not oR2.Eof
XML = XML & "<set name="" & or2("Age") & "" value="" & or2("AVGHeight") & "" />"
oR2.MoveNext
Wend
Next
XML = XML & "</graph>"
But when I run this it gives me this error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] You tried to execute a query that does not include the specified expression 'Age' as part of an aggregate function.
|
|
|
|
|
It looks as though you've not put a space before Group by, so the string would seem to be select AVG(Height) as AVGHeight, Age from [User] Where Age=1Group By Age in the first iteration. Put a space in there and see what happens.
|
|
|
|
|
I want to get the gridview's specified column highlighted onmouseover as well as the row. Can somebody help ?
Kavita
|
|
|
|
|
Read this post on the asp Forum:
http://forums.asp.net/p/1074580/1576884.aspx#1576884
|
|
|
|
|
In the rowCreated event, You can add and attribute to that cell.
Example:
e.Row.Cells(8).Attributes.Add("onMouseOver", "alert('do something')")
|
|
|
|
|
Hi,
Thanks for the reply.
But this does not solve the problem.
It will highlight only one cell, I want to highlight the whole column on mouseover.
For Eg: If I take the mouse on one cell of 2nd column then the complete column 2 should get highlighted and the corresponding row too.
Kavita
|
|
|
|
|
Use Onrowdatabound event and write the code inside
e.Row.Attributes["onmouseover"] = "this.style.cursor='hand';this.style.textDecoration='underline';";
|
|
|
|