|
you can do this is VBScript/ASP like this:
Hope it help!
dim strSelect, arrSelect
strSelect = Request.Form("APPMANAGER")
' check to see if user select multiple
if Cint(inStr(strSelect, ",")) > 0 then
' user selects more than one entry, put in an array collection
arrSelect = split(strSelect, ",")
for i = 0 to UBound(arrSelect)
' you put send mail here or call a function to send mail
doMail(arrSelect(i))
Response.Write arrSelect(i)
next
' now you can do whatever with it.
else ' strSelect has only one entry you can do it here.
' you can send mail here or call a function to send mail.
doMail(strSelect)
Response.Write "you select : " & strSelect
end if
sub doMail(managerID)
' do mail here
end sub
__________________________________________
lizhill
|
|
|
|
|
I'm designing a ASP.NET Server Control, that has a designer verb, so that when you click on it, you're presented with a window to edit the control's subobjects. One of the properties of the subobject is a dropdown of all the available controls on the page that owns the control. Thus far, the only way that I've been able to get the page object to the TypeConverter that populates the dropdown is to use a global shared variable to hold a reference to the page object (it's a hack, and I don't like it, but it DOES work). So that's my question. How can I get ahold of the page object from with in the TypeConverter?
Example of what I'm trying to do (yes, it's in VB.NET... you haven't gone blind ):
'HACK: Temporary fix for accessing the Page object
Friend Class PageData
Public Shared m_Page As Page
End Class
Public Class MyTypeConverter : Inherits TypeConverter
Public Overloads Overrides Function GetStandardValuesExclusive(ByVal context As ITypeDescriptorContext) As Boolean
Return True
End Function
Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As ITypeDescriptorContext) As Boolean
Return True
End Function
Public Overloads Overrides Function GetStandardValues(ByVal context As ITypeDescriptorContext) As StandardValuesCollection
Dim List As New ArrayList()
Dim C As WebControl
For Each C In PageData.m_Page.Controls
List.Add(C.ID)
Next
Return New StandardValuesCollection(List)
End Function
End Class
Public Class MyCustomControlSubObject
Protected m_BuddyControl As String
.
.
<TypeConverter(GetType(MyTypeConverter))> _
Public Property BuddyControl() As String
Get
Return m_BuddyControl
End Get
Set
m_BuddyControl = Value
End Set
End Property
End Class
Thanks in advance.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
I have a web page which displays a table with about 10 columns and hundreds of rows. The problem is that when the user scrolls down to see the lower rows, the first row (which contains the name of each column) scrolls away and the user has a hard time figuring out what each column represents.
The solution: to make the rows scrollable!
I broke the table up into two separate tables -- the top one containing just the row with the column titles and the bottom ones containing the actual data. I enclosed the bottom table inside a div with overflow-y:auto. This gives me the effect I need, but I had to make some adjustments:
1. Resize the div when the user resizes the browser window. No problem.
2. Resize the div when the number of rows is smaller than its height. No problem.
3. Make each column in the top table the same width as the corresponding column in the bottom table. Big problem!
My algorithm for resizing the columns is pretty simple (see below). First it makes the size of the top columns the same as the ones in the bottom table. Then, for any columns that remain out of synch, the bottom columns are resized to match the top columns. This works beautifully as long as the window is big enough. As soon as I start shrinking it too much, the columns can no longer be matched in width and the whole thing looks ugly.
Do you know of any JavaScript code I can use that can do this for me? I basically need an algorithm for keeping the column widths of two tables (with the same number of columns) consistent. This is only for IE; I don't care about Netscrape.
Thanks a bunch!
Alvaro
function matchColumnWidths(tableHeading, tableData)
{
if (!document.all)
return;
if (tableHeading.rows.length == 0 ||
tableData.rows.length == 0 ||
tableHeading.rows(0).cells.length != tableData.rows(0).cells.length)
return;
for (var i = 0; i < tableData.rows[0].cells.length - 1; i++)
{
tableHeading.rows[0].cells[i].width = "";
tableData.rows[0].cells[i].width = "";
}
for (var i = 0; i < tableData.rows[0].cells.length - 1; i++)
tableHeading.rows[0].cells[i].width = tableData.rows[0].cells[i].clientWidth -
(tableData.cellPadding * 2 - (tableData.cellPadding - tableHeading.cellPadding) * 2) +
(tableData.cellSpacing - tableHeading.cellSpacing);
for (var i = 0; i < tableData.rows[0].cells.length - 1; i++)
{
if (tableHeading.rows[0].cells[i].clientWidth != tableData.rows[0].cells[i].clientWidth)
{
tableData.rows[0].cells[i].width = tableHeading.rows[0].cells[i].clientWidth -
(tableHeading.cellPadding * 2 - (tableHeading.cellPadding - tableData.cellPadding) * 2) +
(tableHeading.cellSpacing - tableData.cellSpacing);
}
}
}
Insanity: doing the same thing over and over again and expecting different results. - Albert Einstein
|
|
|
|
|
Why don't you use an inline frame (<iframe> ) or a frameset for the data? That way the page won't scroll, just the data.
As far as column widths. Specify absolute pixel values instead of a percentage for everything - including the table itself. Or use CSS positioning to do the same thing.
Jeremy Falcon
Imputek
<nobr>"C# is the answer to a question nobody asked." - Chris Losinger
|
|
|
|
|
Jeremy,
I'm only having a problem with the column widths. I am using absolute pixel widths. But they don't always work as expected. For example, setting a particular column's width may cause other columns to be resized (by IE) unexpectedly.
Thanks anyway. If you (or anyone else) wishes to spend some of their time tackling this problem, I'd be happy to send a small HTML file that shows the problem.
Regards,
Alvaro
Insanity: doing the same thing over and over again and expecting different results. - Albert Einstein
|
|
|
|
|
I found a way to make it work!
The trick is to add the exact same row of the top table to the bottom table, but make it invisible. This is accomplished by setting the row's style to visibility:hidden; position:absolute.
Unf*ckingbelievable! After two days battling this problem I finally came up with a solution that works and looks great. I'm very happy!
Regards,
Alvaro
Insanity: doing the same thing over and over again and expecting different results. - Albert Einstein
|
|
|
|
|
In every sites that have login form,after you enter your name and PRESS ENTER,login operation happen.I want to know how can I catch enter pressed and do logining.I use ASP.NET.
Thanks
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
You can use Javascript to perform this function. Here is the sample code.
This javascript function recives the event object and uses the keyCode property to check for character '13' which is a carriage return.It submits the form and returns false so when the user clicks enter, the carriage return is not added to the field. If it is not 13 then allow the character to be typed in.
<br />
function CheckForEnter(oEvent)<br />
{<br />
if(oEvent.keyCode=='13')<br />
{<br />
return false;<br />
myform.submit();<br />
<br />
}<br />
else<br />
{<br />
return true;<br />
}<br />
<br />
<br />
}<br />
here is the HTML for a textfield, use the keyonpress event so that way the event fires before the character is actually entered.:
<br />
<form id=myform action=test.aspx runat=server><br />
<input type=text id=txtTest onkeypress="return CheckForEnter(event);"><br />
</form><br />
thats all there is to it.
Jared Solomon
Programmer/Analyst
|
|
|
|
|
Thank you.I have to check it.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Sir,
i had developed html page there is lot of content and some button also display in that page. On Html page one print button is there. when i print html on paper it aslo print "button" also on paper.
I don't want to print "button" on paper. i want to print only content on paper.
How should i do that
Regard raju
|
|
|
|
|
Raju Pande MKCL Pune wrote:
I don't want to print "button" on paper. i want to print only content on paper.
CSS to the rescue! G'damn I love CSS.
Ok, but this only works on modern browsers so if your print needs to work on IE4 or Netscape 4 or earlier, then this won't work and you will have to create a totally seperate page without a button.
Basically you have two CSS files. One for the screen and one for printing. In your HTML page you code this:
<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
<link rel="stylesheet" type="text/css" media="print" href="css/print.css" />
So there you have reference two style sheets, and the media attribute tells your browser which one to use for which media, screen for on screen and print for printing. You can also specify mobile, braille, handheld etc. etc.
Then in your screen.css file you do this:
input{
display: block;
}
and in your print.css file you do this:
input{
display: none;
}
That display: none; tells the browser not to show the input element at all, and because it is in your print media CSS file, it won't show up on your printed page.
You can see an example of this at Zeldman's A List Apart site. Look at the page on your screen and then print it. You will see a big difference and that is because he has used print media and a screen media CSS files.
You can of course do this technique to any element on the page you do not want printed. Images, tables, divs etc. etc. You can also re-layout your page to print properly.
Hope that helps.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
|
|
|
|
|
I have a scenario: I have a table names DSAUsers that includes a user's User ID, First name, Last name, password, profile and email address.
What I want to do is:
SELECT email FROM DSAUsers WHERE profile = 'EQUIFAX'
I have several people with the EQUIFAX profile. I want to get all the email addresses and compile a string of them seperated by ";" so that I can include them on my CDONTS TO line. How the heck do I do this? I can get my string to write out to the screen by Response.Write, Movenext, Loop, but I can't get the thing to write to an object that I can use...HOW DO I DO THIS PLEASE???
|
|
|
|
|
Perhaps try something like this:
Within the recordset loop:
strEmail = strEmail & objRS("MyEmailField") & ";"
And after the loop:
' Get rid of the final ;
If strEmail <> "" Then
strEmail = Left(strEmail, Len(strEmail) - 1)
End If
Best regards,
J. Paul Schmidt - Freelance ASP Web Developer
http://www.Bullschmidt.com - To put live data on the Web...
|
|
|
|
|
This worked like a charm...I knew it would be something simple! Thanks a million for your help!!
Robby
|
|
|
|
|
Is there a way to fill out a web form by specifying values in the URL?
Johnny
|
|
|
|
|
You could use a querystring and the plug in the values from the querystring.
Example:
URL : http://www.yoursite.com?testparam=hello&testparam2=hello2
asp:
i hope this helps
Jared Solomon
Programmer/Analyst
|
|
|
|
|
Only if you're hosting the form and you can add code to parse the parameters and fill in the form.
Todd Smith
|
|
|
|
|
JohnnyNin wrote:
Is there a way to fill out a web form by specifying values in the URL?
I was going to reply that you can only do it via ASP (or some other server side language) and you would have to do it as Todd and Jared said above.
However I found this library which lets you use JavaScript to access the QueryString which is totally awesome: Using Query Strings from JavaScript[^]
The actual JS library file
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
|
|
|
|
|
I used Interdev to debug my asp page, but I can only debug server-script,
break point at client script code didn't work (it said that:"The break point
will not current be hit.The current document is not loaded", I'm sure that
it is loaded).
I read MSDN Library ,but I still can't solve this problem.
I hope to kick this trouble away with your help.
Thank you very much for your interest.
|
|
|
|
|
What version of Windows/IE do you have? Microsoft has a script debugger but depending on your config it may or may not be enabled by default. Just remember that you won't be able to use server objects all that well when debugging client code.
Jeremy Falcon
Imputek
<nobr>"C# is the answer to a question nobody asked." - Chris Losinger
|
|
|
|
|
Hello!
My platform is Windows 2000 Server (IIS) and I'm attempting to make a small CGI-program using C++.
I'm able to receive arguments through argc/argv using url something like
www.mysite.com/somename.cgi?value
But if I'm trying to receive form data the url might look something like (if using GET-method) this: www.mysite.com/somename.cgi?variable=value
If the url contains a '='-sign my program doesn't receive any arguments. I've found tutorials on the web describing how to receive form data in PERL/Unix, but not for C/Windows.
So the CGI-newbie question is: How do I receive the data if the url has '='-sign? And if this is possible at all, is there any difference if the method is POST or GET?
I'm happy to read the ******* manual if you just point me where to start..
Thanks, Eero
P.S. I hope the only possible answer isn't "Use ISAPI"..
|
|
|
|
|
You need to access the HTTP environment variables and decode them.
Here's an example I like that'll get you started. It's called cgi-util and has wrapper functions in it to help you out.
Download
Jeremy Falcon
Imputek
<nobr>"C# is the answer to a question nobody asked." - Chris Losinger
|
|
|
|
|
Ok, that wasn't very complicated. I made my own wrapper and it works like a dream.
Thanks!
--------------
Eero Kuutschin
|
|
|
|
|
Hello.
Does anyone have a script for a good search function, that doesn't need a Database?
I've downloaded every single one I could find but they were no good.
I want someting that will search all files in the root directory for a keyword/s and then display in the results
the sentence in which the keywords were found, or similar. Like Google does.
Or, if that can't be done, is there a way to automatically update a database with the site's contents?
because I don't want to have to go and update a database everytime I make changes to my site.
Cheers.
|
|
|
|
|
NathanScott wrote:
Like Google does.
You can always buy search services from Google. They even have an appliance which you plug into your network and it provides search results.
Also you could write a simple script in ASP.NET which uses the FileSystemWatcher component to automatically update the database when a file changes.
Apart from that, not many search engines which do not use a database.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
|
|
|
|