|
ASPnoob wrote: I don't quite understand it since I got it off the web.
If you find code online and you don't understand it, read MSDN so that you do. Using code you don't understand is not a wise move. It sure doesn't help you learn anything.
ASPnoob wrote: Me.CarNamesDL.DataTextField = "CarID" Me.CarNamesDL.DataValueField = "Model"
This code means that the value field should contain the value stored in the 'Model' column, and the value shown in the list should be the 'CarID' column. You should probably look at the HTML to see what's being stored in the value field, then you can work out which step is failing to work properly.
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 understood those two lines perfectly well, its the following line that I'm unsure about even after reading the MSDN.
CarNamesDL.SelectedValue
It supposed to return the value of the selected ListItem but in the tutorial that I was reading " & CarNamesDL.SelectedItem.Text & " and CarNamesDL.SelectedValue & " returned the same value. Thats where I got the code above and its confusing me since its doing something different from what the MSDN said its supposed to do. According to the MSDN, SelectedValue is supposed to return the value stored within the selected listitem. Please correct me if I misunderstood what the MSDN said. Thank you for your response.
-- modified at 21:25 Wednesday 25th July, 2007
|
|
|
|
|
You can obtain the value and displayed text like so:
ddl1.SelectedItem.Value.ToString() / value
ddl1.SelectedItem.Text / displayed text
e.g.
<br />
'//add a few items to the drop down:<br />
ddl1.Items.Add(New ListItem("Honda", "hnd05"))<br />
ddl1.Items.Add(New ListItem("Ford", "frd07"))
The value of the first item would be hnd05 and the text would be Honda.
Hope this helps.
|
|
|
|
|
hi
How can I solve this problem in DB2.I am using C#.
ERROR [22007] [IBM][DB2] SQL0181N The string representation of a datetime value is out of range. SQLSTATE=22007
Any help
|
|
|
|
|
Hi.
I can't run a simple ASP (Not ASP.Net) file, with IIS in windows vista.
this is all in my file:
***************************
<%@ language="vbscript" %>
<%
Response.Write('aa')
%>
****************************
but when browse it this page will be displayed:
*******************************
The website cannot display the page
HTTP 500
Most likely causes:
The website is under maintenance.
The website has a programming error.
********************************
my IIS is start .....!!!
Best wishes
|
|
|
|
|
Turn off "friendly http error messages" in your browser, so that you see the actual error message.
---
single minded; short sighted; long gone;
|
|
|
|
|
IIS may be started, but from this and your other posty it looks to me like you haven't used it to configure the folder where this file is to be an ASP web applciation.
|
|
|
|
|
Hi.
I want to run a simple ASP code (ASP 3, Not ASP.Net) with IIS in Vista, but I receive an error:
My HTML File:
**********************************
*********************************
1.asp File:
*******************************
<%@ language=vbscript %>
<%
dim a = request("txt")
response.write(a)
%>
*******************************
when run with IIS and browse html file, when click button this Error Page (1.asp) will be displayed:
*******************************
Server Error in Application "Default Web Site"
-------------------------------------------------------------------------------
HTTP Error 405.0 - Method Not Allowed
Description: The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.
Error Code: 0x80070001
Notification: ExecuteRequestHandler
Module: StaticFileModule
Requested URL: http://localhost:80/MyWeb/1.asp
Physical Path: D:\Projects\MyTestWeb\1.asp
Logon User: Anonymous
Logon Method: Anonymous
Handler: StaticFile
***************************************************
Best wishes
|
|
|
|
|
I have an asp.net application using C# code. When I try and view the
pages in design mode I get 'error creating control' messages with 'Attempted
to read or write protected memory. This is often an indication that other
memory is corrupt'
Anyone have any ideas as to what causes this?
|
|
|
|
|
I want to send an email to multiple people and I want to store the addresses in the web.config file.
Therefore my web.config has the following
<add key="NotificationEmailAddresses" value="ronald@macdonald.com; harry@barry.com"/>
and my code looks like this. Some essential has been ommited
Dim message As New MailMessage()<br />
<br />
message.From = New MailAddress("site@homesolution.ltd.uk", "Homesolution Site")<br />
message.To.Add((ConfigurationManager.AppSettings("NotificationEmailAddresses"))<br />
<br />
message.Subject = "New Event Occurred"
For some reason this doesn't seem to work. The email never arrives and no error appears. How do I get this to work so I can send to multiples.
Thanks
|
|
|
|
|
When I have done this before I sent a sepparate email to each person. Here is some C# code in .net 2.0 assuming you have a comma delimited list in your config file.
MailAddress to = null;
bool ret = false;
if (p_to.IndexOf(",") != -1)
{
string[] addrs = p_to.Split(',');
for (int i = 0; i < addrs.Length; i++)
{
to = new MailAddress(addrs[i]);
ret = SendEmail(to, null, null, p_subject, p_body);
if (!ret)
{
return ret;
}
}
return ret;
}
else
{
to = new MailAddress(p_to);
return SendEmail(to, null, null, p_subject, p_body);
}
<\pre>
The SendEmail method just wraps the smtp sendmail function.
Hope that helps.
Ben
|
|
|
|
|
I'm trying to figure out, how to take a file from a win form and place it in a treeview control on the website???
|
|
|
|
|
What kind of file? What is the file structure? When you say "take a file from a win form", what do you mean? e.g. A code file, text file, xml file
|
|
|
|
|
Ive got a dataview with a hidden label and a visible hyperlink. The hyperlink NavigateUrl is formed with hard text, and the text of the hidden label.
How do i incorporate the label text into the NavigateUrl via the HTML of the page?
I know how to do this in the code behind but would like to do it simply in the html link.
Please help.
Many Thanks!!
|
|
|
|
|
Hi
Can anybody tell me regular expression for date.i.e month should not
greater that 12 day should not greater than 31 and same for year.
Rahul
|
|
|
|
|
A regular expression would have a pretty tough time telling that a date is valid. Following your rules, the following date is valid: 31-02-2007. If you want to use Javascript to validate the date, this[^] might help.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi my friends
i need ur help.
how can i access to element of my page when i use a masterpage for create my page.
in other word: i want to check the checked property of my checkbox with javascript and i can't do it. so please help me.
thank you
www.toolsfa.com
msma
|
|
|
|
|
Hi,
In masterPage Name and Id of page controls changs.
you should use ClientID property of server controls in the page for accessing that in MasterPage i.e:
function CheckValue()
{
var obj=document.getElementById('<%= CheckBox1.ClientID %>');
alert(obj.getAttribute("checked"));
}
Regards
|
|
|
|
|
Hi, i get an error message when i try to see my web site from another PC, (i created a virtuel folder,etc with IIS)
#######
--------------------------------------------------------------------------------
Erreur d'exécution
Description : Une erreur d'application s'est produite sur le serveur. Les paramètres d'erreur personnalisés actuels pour cette application empêchent l'affichage à distance des détails de l'erreur de l'application (pour des raisons de sécurité). Cependant, ils peuvent être affichés par les navigateurs qui s'exécutent sur l'ordinateur serveur local.
Détails: Pour permettre l'affichage des détails de ce message d'erreur spécifique sur les ordinateurs distants, créez une balise <customerrors> dans un fichier de configuration "web.config" situé dans le répertoire racine de l'application Web en cours. Attribuez ensuite la valeur "off" à l'attribut "mode" de cette balise <customerrors>.
<configuration>
<system.web>
<customerrors mode="Off">
Remarques: La page d'erreurs actuellement affichée peut être remplacée par une page d'erreurs personnalisée. Pour ce faire, modifiez l'attribut "defaultRedirect" de la balise de configuration <customerrors> de l'application, de sorte qu'il pointe vers une URL de la page d'erreurs personnalisée.
<configuration>
<system.web>
<customerrors mode="RemoteOnly" defaultredirect="mycustompage.htm">
###########
Can someone help me !?, thanks
|
|
|
|
|
My french is a little rusty, but that looks like a general error you get when you don't have a custom error page turned on. The actual error could almost be anything. I would guess you have a setup problem with your site in IIS. If you check your web.config your if you have customeErrors="on" then there is a defaultRedirect where you need to put in an errorpage that will display the error.
Hope that helps.
Ben
|
|
|
|
|
Hi,
I am using ASP.NET 1.1 and want to know if the regular expression validator control works in Firefox. I added such a control and it still made a trip to the server. How do I get this control to work in 1.1?
Regards
ma se
|
|
|
|
|
The problem you've got is that Firefox is treated as a down-level browser in 1.1. What you need to do is add the following into your web.config file.
<browserCaps>
<case match="^Mozilla/5\.0 \([^)]*\) (Gecko/[-\d]+)?(?'type'[^/\d]*)([\d]*)/(?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*)).*">
browser=Gecko
type=${type}
frames=true
tables=true
cookies=true
javascript=true
javaapplets=true
ecmascriptversion=1.5
w3cdomversion=1.0
css1=true
css2=true
xml=true
tagwriter=System.Web.UI.HtmlTextWriter
<case match="^b" with="${letters}">
beta=true
</case>
</case>
</browserCaps></code>
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I need to implement an album module to my new web site. Can somebody explain to me, the best practices in implementing a Web Photo Album in .NET. I would like to know about, how to maintain the folder for the albums etc. I know that there is a practise of creating folder sfrom a - z and then creating sub folders in these folders based on the first alphabet in the user name. If somebody has done a similar kind of thing, can you explain how you implemented this.
|
|
|
|
|
I would recommend storing the images in the DB itself, then maintaining structures and such becomes much easier. It will also allow you to reorganize the structure, add, delete etc. much easier.
If you interested, there is a starter kit you can download that has much of this functionality built in. You can DL from the asp.net site. Its the personal web site kit (or something like that).
It would be easy to modify that piece of the kit to suit your needs. If you don't want to do that, there are umteen articles on the web on how to add and retrieve images from a DB.
My 2 cents.
|
|
|
|
|
Hi in my grid i am binding some of the records...,
In that one of the boundcolumn field some the values are null(not show anything)...,
So i like to count how many cells are like that...,
So i used this code:
Dim count As Integer = 0
For Each MainGRD As DataGridItem In Me.dgrdmain1.Items
If (MainGRD.Cells(0).Text) <> "" Then
count = count + 1
End If
Next
lblNoofDays.Text = "No Of Days" & ":" & count
But its counting and show all the values...,
How to solve the prbs plz any one help me,
Advance thanks
Regards,
Magi
|
|
|
|