|
I have a pretty simple situation here. I have two DIVs, one of which has float left set and the other which has everything at default. In the left column I have an ASP.NET menu control. In the right column, I have some text.
In IE only, hovering over a menu item with submenu items makes the last couple of items disappear from my menu. However, if I resize the window so that the text on the right side is longer than the menu, the problem goes away. What could be causing this problem?
|
|
|
|
|
I figured out that it may not be the menu. I placed an hr element just below the menu. When I hovered over a menu item with sub items, the hr also disappeared. Any ideas?
|
|
|
|
|
AHA!
set the right hand div to float right. I can't believe I missed this. Everything else fell right into place.
|
|
|
|
|
Hello,
I created a webform.aspx with MS visual studio.net 2003.It has a listbox and a textbox.My page loads the listbox with list of name from a table(profile) from the database.when i select a name anomg the one loaded in the listbox, i want it to insert the personalID of the selected name from the same table(Profile) in the database.
After putting the code behind the page and text my web page, it will load the data from the profile table into the listbox successfully but when i select a name from the listbox, it won't insert the corresponding personalID into the textbox.Instead i get an error message that says [B]"Index 0 is not non-negative and below total row".
Please i need some one to help me correct my code.
Here is the code behinde the page:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not Me.IsPostBack Then
Dim SqlConnection1 As New System.Data.SqlClient.SqlConnection
SqlConnection1.ConnectionString = "data source=xuzia;initial catalog=Pinfol;user id=sa"
Dim cmd As New SqlClient.SqlCommand
cmd.CommandText = "SELECT PersonalID, Name FROM Profile"
cmd.CommandType = CommandType.Text
cmd.Connection = SqlConnection1
SqlConnection1.Open()
Dim DS As New DataSet
Dim DA As New SqlClient.SqlDataAdapter
DA.SelectCommand = cmd
DA.Fill(DS, "Profile")
ListBox1.DataSource = DS
ListBox1.DataMember = "Profile"
ListBox1.DataTextField = "Name"
ListBox1.DataValueField = "PersonalID"
ListBox1.DataBind()
SqlConnection1.Close()
End If
End Sub.
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Dim prodID As Integer
prodID = ListBox1.SelectedIndex
Dim SqlConnection1 As New System.Data.SqlClient.SqlConnection
SqlConnection1.ConnectionString = "data source=xuzia;initial catalog=pinfo;user id=sa"
Dim SqlSelectCommand1 As New System.Data.SqlClient.SqlCommand
Dim cmd As New SqlClient.SqlCommand
cmd.CommandText = "SELECT PersonalID, Name FROM Profile WHERE PersonalID = " & prdID
cmd.CommandType = CommandType.Text
cmd.Connection = SqlConnection1
SqlConnection1.Open()
Dim DS As New DataSet
Dim DA As New SqlClient.SqlDataAdapter
DA.SelectCommand = cmd
DA.Fill(DS, "Profile")
txtID.Text = DataBinder.Eval(DS, "Tables[Profile].DefaultView.[0].PersonalID")
txtID.DataBind()
End Sub
I will appreciate all help.
Ktsis.
|
|
|
|
|
To start off, you don't need to run another sql query inside your index changed event handler. All that you are extracting from your query is PersonalID and Name . This information is already available to you in your ListBox since you bound the text field to Name and the value field to PersonalID . It looks like all you're doing is setting the txtID.Text to the value of PersonalID . You could probably replace all that event handler code with this:
txtID.Text = ListBox1.SelectedItem.Value
Logifusion[^]
|
|
|
|
|
You are using a variable "prdID" to create the SQL query, that you never assigned any value to.
I suppose that you meant to use the variable prodID instead.
You should use Option Explicit so that you can't use variables that you didn't create.
---
b { font-weight: normal; }
|
|
|
|
|
I need a calender control that should have the following features:
1. Its size should be a fixed one
2. User should not be allowed to select dates other than the current & future dates.
3. It should be movable within the page
4. The maximize button should be disabled
i need the calender control with above features so that i can use it in my asp.net webpage.
pl kindly help me
thanks a lot
arun hegde
|
|
|
|
|
I'm not sure if there is such a control that meets all what you need, but IMO you might want to check out the Peter's Date controls[^] , and consider using it with Atlas[^]
|
|
|
|
|
I want to create a page where when a user loads the page they are prompted to download a file? Like when you click on a link to download a file, but I want that prompt to come up when the page loads?
How do I do this?
/\ |_ E X E GG
|
|
|
|
|
On PageLoad of youe asp.net page use the following
Response.Redirect("mypdf.pdf")
This will ask for the pdf to get downloaded before the page is loaded.
Look where you want to go not where you don't want to crash.
Bikers Bible
|
|
|
|
|
Does anyone know of any software that can automatically create a JPEG/GIF image of a PDF without actually opening the PDF?
For example, check out this site:
http://www101.iprint.com/cgi-shl/index.cgi?shop=100&level=44957&ad=729AU100B58&source=GOOG&keyword=brochure%20creator&gclid=CPq3--Ds6YUCFStvFQodEkQSxg&date=2006%3A06%3A30%3A08%3A28%3A39[^]
On the first page, click the "Brochures" link. On page 2, select one of the "outside" templates, then select an "inside" template, and click continue.
Ok, the next page, Design Studio, is where I have a question. How are they generating that large image of the brochure? If you alter the text, the JPEG image updates as well. Does anyone know of any software that does this?
The reason I need it is our clients' website creates a PDF of a customizable brochure (just like the one on iPrint), however we want to display a snapshot of the PDF WHILE the customer is creating it. Currently, we're trying to do this through HTML tables however it doesn't look EXACTLY like the PDF so our client is unhappy.
So if anyone knows of any software that can capture a snapshot of a PDF or of a tutorial on how to do this, I would greatly appreciate it.
Thanks in advance.
-Goalie35
|
|
|
|
|
try activePDF.
www.activepdf.com
Look where you want to go not where you don't want to crash.
Bikers Bible
|
|
|
|
|
Hello,
I have two buttons on one of my VehicleDetails.aspx page. Obiviously
these two buttons takes the user to two different pages. Now my client
is interested in having a linkbutton instead of the two buttons. Once
the user clicks on the linkbutton a javascript dialog box popsup that
says "Is the Lessee buying this vehicle?" and with two buttons "Yes"
and "No". If user clicks "yes" it should go to DealerQuestions.aspx"
and if "No" it goes "lesseePurchase.aspx" page offcourse with few parameters attached in the query string.
As of now I have two buttons like I mentioned earlier where in under
the button click event I am doing a Response.Redirect() to the mentioned
pages.
This is what I did to have the pop up box popped up with a buttons.
_lnkDLpurchase.Attributes.Add("onclick", "if( confirm('Will Lessee buy this vehicle?') ) return True; else return false;")
So far ever thing looks fine. But how do I do
If user clicks on "Yes" it should execute the code
Response.Redirect("LesseePurchase.aspx?DealerShipID=" &
_lblDealerShipIDValue.Text)
when "No" this should go to another page
Response.Redirect("DealerQuestions.aspx?DealerShipID=" &
_lblDealerShipIDValue.Text)
I don't know how to get to two buttons exectue two different codes
based on what was clicked on.
Please help,
Thanks in advance
-L
|
|
|
|
|
You could create a javascript function rather than your inline code and rather than response.redirect , do a document.location.href = 'myurl'
|
|
|
|
|
Can you help me with that. I am not sure if we can capture the parameters in the javascript function. Because the control will be directed to different pages based on what was clicked on. Say if "Yes" it goes to the
Response.Redirect("LesseePurchase.aspx?DealerShipID=" & _lblDealerShipIDValue.Text & "&ContractID=" & _lblContractIDValue.Text & "&VIN=" & Vin & "&fname=" & _lblFirstNameValue.Text & "&lname=" & _lblLastNameValue.Text & "&AcctNum=" & _lblAccountNumberValue.Text & "&VehicleID=" & _lblvehicleID.Text & "&ManufacturerID=" & _lblManufacturerID.Text)
and if "No" then the control goes to the below page with these many parameters.
Response.Redirect("DealersQuestions.aspx?DealerShipID=" & _lblDealerShipIDValue.Text & "&ContractID=" & _lblContractIDValue.Text & "&VIN=" & Vin & "&fname=" & _lblFirstNameValue.Text & "&lname=" & _lblLastNameValue.Text & "&AcctNum=" & _lblAccountNumberValue.Text & "&VehicleID=" & _lblvehicleID.Text & "&ManufacturerID=" & _lblManufacturerID.Text)
And this is my LinkButton in the .aspx page
<asp:linkbutton id="_lnkDLpurchase" runat="server">Will Lessee buy this vehicle?Thanks in advance,
-L
|
|
|
|
|
Well. It looks like all the parameters are in html controls on teh page, apart from VIn (which you could put in a hidden field). So potentially, you could access all of these using javascript and then do your redirect :
var fname;
fname = window.document.form1._lblFirstNameValue.Text
... umm actually...
hmm..
Not too sure that javascript likes all your underscores though...
|
|
|
|
|
I think that paddyboyd proposed you a good solution, but if you want to keep your server side code, then you can store value returned from confirm(...) box to a hidden field and then just read it from this field on server side.
You didn't mention which version of .NET you are using, but in ASP.NET 2.0 it should be roughly like this:
<asp:HiddenField runat="sever" id="myHiddenField"/>
protected void Page_Load(object sender EventArgs e)
{
_lnkDLpurchase.Attributes.Add("OnClientClick",
"document.getElementById("myHiddenField").Value = (confirm('Will Lessee buy this vehicle?')) ?
"lease" : "dealer");
_lnkDLpurchase.Attributes.Add("OnClick", "_lnkDLpurchase_Click");
}
protected void _lnkDLpurchase_Click(object sender EventArgs e)
{
switch(myHiddenField.Value)
{
case "lease": ...
case "dealer": ...
}
}
I wrote it from head, maybe there are mistakes but I hope you understand what I mean.
I hope it helps.
-- modified at 11:00 Friday 30th June, 2006
|
|
|
|
|
Hello,
Thanks. Yes this might work for me in my scenario. By the way yes, I am using ASP.NET 2.0 but using VB.NET. So I will have to code your in VB.NET. I will difenitely have more questions on this while I am working on this. I will keep this posting update. So I need your help
Thanks again,
-L
|
|
|
|
|
Also we are using Master pages. So may be I will have to use FindControl to find and identify myHiddenField (in your code) and then go from there. Let us how it goes. Sooner or later I will definitely update with my accomplishment on this.
Thanks
-L
|
|
|
|
|
There are a couple of things come to mind after seeing your code:
+ In the ASP.NET 2.0, you simply use the OnClientClick to add the handler for the client side event onclick of the LinkButton instead of adding to the Attributes collection in code.
+ If you do nothing in the LinkButton click event handler other than calling the Redirect method, you might consider using the hyperlink control instead of the LinkButton to reduce the round trip. Also you can use javascript to collect the input textboxes to build the url for the href attribute of the hyperlink.
+ If you put a lot of things including the text values (from what I have seen in your code) in the query, I think it does not looks good for example when the text length is significant. In this case, you might consider cross-page posting to post a new page which is determined by the result of the confirmation.
|
|
|
|
|
How can i disable dates that are less then today's date in a Calender Webserver Control
|
|
|
|
|
You simply create the DayRender event handler, and do a checking on the rendered date to make it selectable or not.
void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
e.Day.IsSelectable = (e.Day.Date >= DateTime.Now);
}
|
|
|
|
|
I would like to know how to use an ASP.NET 2.0 text box as a password box, much like the windows form textbox's property called password character. I observed that web text box does not have that property.
Can someone please advice me on how to d this?
Live in fragments no longer. Only connect.
|
|
|
|
|
add the TextMode="Password" attribute to the declaration
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Thanks
Live in fragments no longer. Only connect.
|
|
|
|