howto access web controls in user control with javascript


hi
can ny body tell me how to access a control in javascript inside a user control.

currently i m using

function mainTdClick(tabId,tabHref)
{
document.forms[0].elements['MiddleBar1_hdn'].value=tabId;
document.forms[0].elements['MiddleBar1_hdn_href'].value=tabHref;
document.forms[0].submit();
}

middlebar is the name of user control ans hdn is name of hidden variable.

i m using following code in code behind
_mainTd.Attributes.Add("onClick", "mainTdClick(" & _mainTd.ID & ",'" & TabHref(x) & "')")

here _maintd is a cell on which we need click event
Posted On: Friday 26th of October 2012 06:25:07 AM Total Views:  298
View Complete with Replies

RELATED TOPICS OF ASP PROGRAMMING LANGUAGE




howto implement Synchronizer Token Pattern in classic asp

to prevent CSRF I want to implement the Synchronizer Token Pattern in my classic asp application. I understand that iIshould generate a token in session_onstart. What I do not get is how to generate such a token as it should be random and unique. So a simple Rnd() and randomize will not work, right Furthermore should it be hashed in any way How
VIEWS ON THIS POST

208

Posted on:

Friday 17th August 2012
View Replies!

howto convert Days to years, months, days ?

, i have a function which pass in a DATE from the database(variable d). I am supposed to calculate the "Years, Months, Days" between the DATE and the system date. Therefore, i used DateDiff to calculate the days. ASP: --------------------------------------------------------------------------------------------- Function calcTimeSince(d) dtNow=date()
VIEWS ON THIS POST

142

Posted on:

Monday 27th August 2012
View Replies!

customer login, howto with txt file?

I am trying to make a client login system with asp. the users register and their details get written to clients.txt. per client there are 9 lines in this txt file (name, address, etc) username and pw are on lines 4 and 5. at login.asp i capture username and pw into strUsr and strPwd - that works fine. im unsure as to how i should not authenticate those variables against clients.txt. - should i loop through all entries of clients.txt and compare strUsr and strPwd to line 4 and 5 of each entry - should i first create an array with the contents of the whole txt file and then see if strUsr and strPwd match any of the 4th and 5th lines Im not (yet) looking for code, just trying to figure out what is the best way to go about this ... I think i am making it more complicated than it is
VIEWS ON THIS POST

166

Posted on:

Tuesday 28th August 2012
View Replies!

Help : howto get a fileattachment to work?

Hi! Here's my code: And I need something like: Session("AttachFile") = Request("AttachFile") Mailer.AttachFile = Session("File") So that my users can attach a file to the mail they'r sending me. I'm using a form with FromAddress, FromName and then File (the file they'r sending) Can anyone help Angelot
VIEWS ON THIS POST

150

Posted on:

Thursday 11th October 2012
View Replies!

customer login, howto with txt file?

I am trying to make a client login system with asp. the users register and their details get written to clients.txt. per client there are 9 lines in this txt file (name, address, etc) username and pw are on lines 4 and 5. at login.asp i capture username and pw into strUsr and strPwd - that works fine. im unsure as to how i should not authenticate those variables against clients.txt. - should i loop through all entries of clients.txt and compare strUsr and strPwd to line 4 and 5 of each entry - should i first create an array with the contents of the whole txt file and then see if strUsr and strPwd match any of the 4th and 5th lines Im not (yet) looking for code, just trying to figure out what is the best way to go about this ... I think i am making it more complicated than it is
VIEWS ON THIS POST

196

Posted on:

Friday 12th October 2012
View Replies!

howto execute Post operation like the same idea in ColdFusion tag CFHTTP

Originally posted by : Igor (eagleigor@yahoo.com)I recently searched for information about howtoexecute Post operation on files using ASP or any Microsoft technologies,like the same idea in ColdFusion tag
VIEWS ON THIS POST

178

Posted on:

Friday 12th October 2012
View Replies!

howto: uploading files - what to do if the filenames are identical?

Hi I am using Persits' ASPUpload component.\tWhile it works fine, I am wondering what to do if two or more files being uploaded\tshare the same file name. When I saw their documentation, it reads something like this...Forcing Unique File Names By default, AspUpload will overwrite existing files in the upload directory. If this is undeable, the component can be configured to generate unique names for the files being uploaded to prevent overwriting existing files in the upload directory. This is done by setting UploadManager's OverwriteFiles property to False before calling Save: Upload.OverwriteFiles = False This property is True by default. To prevent name collisions, AspUpload will append the original file name with an integer number in parentheses. For example, if the file MyFile.txt already exists in the upload directory, and another file with the same name is being uploaded, AspUpload will save the new file under the name MyFile(1).txt. If we upload more copies of MyFile.txt, they will be saved under the names MyFile(2).txt, MyFile(3).txt, etc.But when I store the fileNames in the database, I am storing something like "C:\Upload\MyFile.Jpg".This thanks to the component's Path property.But when saving, if the component changes the filename, i.e, adds a number in paranthesis, how'd I update the database to reflect the value I hope you got my doubt..Can you help me out of this\t Thank you...RR
VIEWS ON THIS POST

467

Posted on:

Wednesday 17th October 2012
View Replies!

URLs like http://www.pcworld.com/howto/article/0,aid,44543,00.asp

hey i'm new here. how r things i just wanted to understand how urls like http://www.pcworld.com/howto/article/0,aid,44543,00.asp is written i mean the number in the 0,aid,44543,00.asp. also my second question is how urls like www.whatever.com/39499w5886&/sjkjsk/tsh/ are written is this URL encryption and how is it done
VIEWS ON THIS POST

387

Posted on:

Friday 26th October 2012
View Replies!

visual basic in access query from asp? is it possible?

I have a question about using Msft Access queries in ASP. The query I am trying to call contains visual basic functions I wrote in the db to keep the SQL from getting too complex. (I call these functions from several forms and queries, so it was easier than cutting and pasting complex iif statements.) Question 1. Is ASP capable of using queries that call Access specific functions when opening the db with: Set cnnDatabase = Server.CreateObject("ADODB.Connection") cnnDatabase.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";" Question 2. If ASP can use functions with ADOB connection, what is the proper procedure to do so Is there something else I need to include in ASP coding or is it a specific type of open procedure. Sample version of VB code: Function fnEndofWeek(dDate As Date) 'figures out end of week with Sunday being the final day of week If Weekday(dDate) = 1 Then fnEndofWeek = dDate Else fnEndofWeek = DateAdd("d", 8 - Weekday(dDate), dDate) End If End Function Sample version of SQL query that calls function (Any date of the week can be entered in [DateBox] and function will find last day of week.): SELECT [Employee Timesheet].EmployeeID, Sum([Employee Timesheet].[Hours worked]) AS [SumOfHours worked], fnEndofWeek([DateBox]) AS [week ending] FROM [Employee Timesheet] WHERE ((([Employee Timesheet].Date1) Between (fnEndofWeek([DateBox])-6) And fnEndofWeek([DateBox]))) GROUP BY [Employee Timesheet].EmployeeID, fnEndofWeek([DateBox]); And I guess question 3: If I have to rewrite all my vb functions in ASP is there a function example that someone can direct me to I'm new to ASP and need to steal where I can.
VIEWS ON THIS POST

186

Posted on:

Friday 26th October 2012
View Replies!

access variables in disabled form fields

I am having an issue with disabling a form field. The page pulls up records in a database. A user is allowed change the record as needed until it is published in one or both of 2 options (combo boxes). If the record is published in one then all other fields except the unpublished combo box is disabled, allowing the user to publish the other at a later date. However, I run in to my problem here. I cannot access the data in the fields if they are disabled. Is there some way to access the data in the fields while they are disabled Or is there some way to not allow a user to edit the contents of a text fields without disabling it Either way would likely get me past my problem.
VIEWS ON THIS POST

181

Posted on:

Friday 26th October 2012
View Replies!

need to access global address book - Page 2

code was originaly in french so dont hesitate to ask if you dont understand some comments .....
VIEWS ON THIS POST

303

Posted on:

Friday 26th October 2012
View Replies!

I can't access db when install framework

Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query. I test mysite in local machine .I can't update ,insert,delete..in my admin(back web) but I can view and open direct MS access file.mdb then I can. Before i install frame work I can run these function in my admin. IIS 5.1 window XP sp2 Thank you
VIEWS ON THIS POST

169

Posted on:

Friday 26th October 2012
View Replies!

ASP to an access DB

I tried to get help in some access forums but got no reply to this question. So I hope someone here can tell me. I have a form with a password element but when I try to send it to my access DB field that is set up as a password field I get this error Item cannot be found in the collection corresponding to the requested name or ordinal. DO I need to write my code different for a password field here is what I am trying to upload oRS.addnew oRS("user_name") = objFrm("_name") oRS("user_password") = objFrm("_password") oRS("user_level") = objFrm("_userLevel") oRS("customer_ID") = strCustomerID oRS("cat_ID") = Session("controlCatID") oRS.Update It is the line in red that is throwing back the error
VIEWS ON THIS POST

98

Posted on:

Friday 26th October 2012
View Replies!

how to access variables from server to client (with sample code)

good day. isit possible to access variables (code) from ASP server script to ASP client page\t take for example the code supplied below: 'server script 'client code dim x x = svalue 'svalue isfrom server script response.write x
VIEWS ON THIS POST

137

Posted on:

Friday 26th October 2012
View Replies!

ASP not accessing database

! I am having problem for the last couple of days with my ASP application. The HTML pages work fine but when it comes to connect to database (Access 2000) it doesn't opens page. The "Error Type" says nothing in Internet Explorer. Actually it is happening with all my ASP applications that are using Access as database, so I dont think that there can be any problem with the code and Database as they were working fine previously. The problem might be in IIS or ODBC connection.
VIEWS ON THIS POST

289

Posted on:

Friday 26th October 2012
View Replies!

Uploaded txt to an access table

I am trying to find out if I can take an user uploaded file. comma delimited txt file. and read this information into an access table. I have the file upload working now I want to read it into a table, all using ASP
VIEWS ON THIS POST

186

Posted on:

Friday 26th October 2012
View Replies!

does any1 know how to export access info to a excel document using asp

hey i was given the task to make an online html document and link it to a database which i have done via asp but i am stuck on the next part as i am using a server called 7host.com and i was wondering if anyone had any ideas of what i could do with the information on the database next, it needs to do something else like link to an excel document and export hte database information to that excel document does anyone know how to do that if you could it would help me a great deal
VIEWS ON THIS POST

181

Posted on:

Friday 26th October 2012
View Replies!

Prevent users from accessing a web page when the back button is pressed

Is there a way in ASP to prevent users from accessing a web page when the back button is pressed in the browser.
VIEWS ON THIS POST

156

Posted on:

Friday 26th October 2012
View Replies!

can we add colums in access tables from asp

hi guyz, i want to add columns dynamically from asp......say for eg. i have a drop down and from that if a user selects 10 as the value it creates 10 textboxes and then when saved it should generate that much columns in access table for saving............hope u guyz got what i am saying... i want to create fields dynamically in access database. bye
VIEWS ON THIS POST

241

Posted on:

Friday 26th October 2012
View Replies!

access datatypes

I have a field that stores a number. In access I made type number and fieldsize decimal. When I enter in a number (through asp) like 4.5 it automatically puts it in as a 4. What's the trick to keep the decimal part of the number I want to be able to keep the decimal but in my asp only show it if there is a decimal. 4.5 should show as 4.5 and 4 should show as 4 and not 4.0.
VIEWS ON THIS POST

241

Posted on:

Friday 26th October 2012
View Replies!