|
I have an old classic ASP app that I am trying to do some AJAX on (the real way, not Microsoft .Net way). I have a couple of DIVs that are alternated from hidden to visible (depending on if its an UPDATE or READ), which are controlled by a href='#' and an ONCLICK call to some javascript to do the hiding/displaying. My question is, whats the best approach to trigger a database update back when the hyperlink is clicked for the update? Should I be changing the hyperlink to a form button, or have a full form hidden and displayed, rather than just a hyperlink? Just looking for an approach, dont need actual code.
Here is a brief sample of the code I am working with. Note its in a Do..Until loop and returns a few hundred entries back from the database. showHide simply swaps the display: setting, and changeHTML changes the innerHTML of the control passed to it.
<script type="text/javascript">
function showHide<% Response.Write unqID %>()
{
unqID = '<%Response.write unqID %>';
showHide('Comment' + unqID);
showHide('ExpandComment' + unqID);
if(document.getElementById('Edit' + unqID).innerHTML == 'Update')
{changeHTML('Edit' + unqID,'Edit...');}
else
{changeHTML('Edit' + unqID,'Update');}
}
</script>
<a href="#" id="Edit<%Response.write curATMID %>" onclick="showHide<%Response.write unqID %>(); return(false);" class="Comment">Edit...</a>
<div id="<%Response.write "Comment" & unqID %>">
<% Response.Write "<b>" & Trim(db("Comments")) & "</b>" %>
</div>
<div id="Expand<%Response.write "Comment" & curATMID %>" style="display:none">
<textarea id='cmtUpdate<%Response.write "Comment" & curATMID %>' type='text'
style='width:100%; height=60px;'
rows='4' cols='100'>
<%Response.Write Trim(db("Comments")) %> </textarea>
</div>
|
|
|
|
|
|
There is a job board on this site, if you want to hire people, pay for a job ad.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
How to display the contents in all resolution without scrollbar. Even if the resolution is high or low the content should set for that resolution and display entire content with in the screen without scrollbar
Thankyou,
YPKI
|
|
|
|
|
You can use css to lay out a page so that it will flow, but it's not going to look exactly the same on different resolutions, because your image sizes and font sizes will not change to fit.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi guys,
I have the following code where I get values from the logged on user account profile in active directory, but I cannot seem to write back. When i click on the submit button, nothing happens, the page just refreshes. Please I need some help. This is my code:
Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load
If Page.IsPostBack Then
End If
Dim AD_entry As New DirectoryEntry("LDAP://")
Dim objSearcher As New System.DirectoryServices.DirectorySearcher(AD_entry)
'Find user id in Active Directory
Dim search As New System.DirectoryServices.DirectorySearcher(AD_entry)
search.Filter = [String].Format("(SAMAccountName={0})", System.Environment.UserName)
search.SearchScope = SearchScope.Subtree
search.PropertiesToLoad.Add("cn")
search.PropertiesToLoad.Add("mobile")
search.PropertiesToLoad.Add("facsimiletelephonenumber")
search.PropertiesToLoad.Add("homePhone")
search.PropertiesToLoad.Add("pager")
search.PropertiesToLoad.Add("mail")
search.PropertiesToLoad.Add("telephoneNumber")
search.PropertiesToLoad.Add("displayName")
Dim result As SearchResult = search.FindOne()
Dim ad_extension, ad_mobile, ad_home, ad_work, ad_fax, ad_displayName As String
If result.Properties.Contains("pager") Then
ad_extension = result.Properties("pager")(0)
Else
ad_extension = "---"
End If
If result.Properties.Contains("mobile") Then
ad_mobile = result.Properties("mobile")(0)
Else
ad_mobile = "---"
End If
If result.Properties.Contains("homePhone") Then
ad_home = result.Properties("homePhone")(0)
Else
ad_home = "---"
End If
If result.Properties.Contains("telephoneNumber") Then
ad_work = result.Properties("telephoneNumber")(0)
Else
ad_work = "---"
End If
If result.Properties.Contains("displayName") Then
ad_displayName = result.Properties("displayName")(0)
Else
ad_displayName = "---"
End If
If result.Properties.Contains("facsimiletelephonenumber") Then
ad_fax = result.Properties("facsimiletelephonenumber")(0)
Else
ad_fax = "---"
End If
label_user_id.Text = System.Environment.UserName
textbox_Extension.Text = ad_extension
textbox_Office_Phone.Text = ad_work
textbox_Mobile_Phone.Text = ad_mobile
textbox_Home_Phone.Text = ad_home
textbox_Fax.Text = ad_fax
textbox_displayName.Text = ad_displayName
'Set focus to Extension
' Page.RegisterStartupScript("SetFocus", _
' "<script>document.getElementById('" & textbox_Extension.ClientID & _
' "').focus();</script>")
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dirEntry As New DirectoryEntry("LDAP://")
Dim dirSearcher As DirectorySearcher = New DirectorySearcher(dirEntry)
dirSearcher.Filter = [String].Format("(SAMAccountName={0})", System.Environment.UserName)
dirSearcher.SearchScope = SearchScope.Subtree
dirSearcher.PropertiesToLoad.Add("cn")
dirSearcher.PropertiesToLoad.Add("mobile")
dirSearcher.PropertiesToLoad.Add("facsimiletelephonenumber")
dirSearcher.PropertiesToLoad.Add("homePhone")
dirSearcher.PropertiesToLoad.Add("pager")
dirSearcher.PropertiesToLoad.Add("mail")
dirSearcher.PropertiesToLoad.Add("telephoneNumber")
dirSearcher.PropertiesToLoad.Add("displayName")
Dim searchResults As SearchResult = dirSearcher.FindOne()
Dim dirEntryResults As New DirectoryEntry(searchResults.Path)
If textbox_displayName.Text <> "---" Then
dirEntryResults.Properties("displayName").Value = textbox_displayName.Text
End If
If textbox_Office_Phone.Text <> "---" Then
dirEntryResults.Properties("telephoneNumber").Add(textbox_Office_Phone.Text)
End If
dirEntryResults.CommitChanges()
dirEntryResults.Close()
End Sub
|
|
|
|
|
Hello
I seek your help
I dévelloper authentication module in c #, in fact in my database table has a client state (connected, DECON)
I saw that this field is not sufficient for authentication
in fact, a sudden disconnection does not change the value of the field condition
then I seek your help on this point
thank you
|
|
|
|
|
Is that for web development?................If it is not you better post it in C# forum. good luck
|
|
|
|
|
Here is the sample of the page.
http://www.rexraygun.com/test/animation-hugh-walk1.html
I need the navigation menu to always appear over the top of the page content. On this page (and there will be others like it) the menu gets hidden behind the video clip.
How do I force the menu to stay on top of everything OR how do I force the AVI clip (will also be using SWF's in a similar way) to be on the bottom layer so the menu will appear over the top?
Thanks for any help you can provide.
|
|
|
|
|
I presume you've tried using the z-index css property?
|
|
|
|
|
I've always had problems with floating menus over the top of drop down lists due to the way the windows are drawn. I've always solved this by putting an iframe in the same position as the div (and with the same size). I'm not sure if this will solve the problem you have but it may be worth a try.
|
|
|
|
|
Hi All,
Having a slight issue here. I am using oracle 10 along with vb.net. I am linking documents to an object (GIS) but my internet explorer (IE8) is not allowing me to do so. i did find the solution by enabling then "Include local directory path when uploading files to a server" option. But since the nature of the site, is obviously Server-side and client-side (as are all sites) i do not want to go to each client machine and enable this.
Does any one know how i can possible use BHO to work around this, or would any one know a simple work around?
Keep it real
|
|
|
|
|
if it works in ie7, you can make ie8 emulate ie7 by using the foloowing meta tag:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
|
|
|
|
|
We may get below error when we are using some ports which are used by mozilla.
"This address uses a network port which is normally used for purposes other than Web browsing. Firefox has canceled the request for your protection."
To check out the blacklist ports here : http://www.mozilla.org/projects/netlib/PortBanning.html#portlist[^]
Solution for above error...
- Open Firefox
- Type about:config in the address field
- Right click anywhere on the screen
- Click new --> string
- Enter preference name as: network.security.ports.banned.override
- Enter string value as: 101(or whatever port number you want)
Thats it
Happy Programming 
|
|
|
|
|
Hi..
My web application is in Visual studio 2005 asp.net/c#.
I have sql server 2005 database at back end.
When run the project in visual studio my application connects with the database, but i have configured the website in local IIS, the website runs but it does not connect to the database.
I am getting following error:
Cannot open database "db1" requested by the login. The login failed.
Login failed for user 'HEM-BE419D4FB41\ASPNET'
I am using Windows authentication to connect to sql server.
my connection string is as follows
"Data Source=HEM-BE419D4FB41;Initial Catalog=db1;Integrated Security=True"
Please tell me the solution
thanks,
Hemant Thaker
By:
Hemant Thaker
|
|
|
|
|
|
i have cobmobox (chapters_combo) with visible= true and another two combos with visible = false
i want when selecting chapter1 from chapters_combo then make the first combo visible = true
and selecting chapter2 from chapters_combo then make the second combo visible = true
chapters_combo has autopostback = true
the problem each time selecting an item from chapters_combo the whole page update.
is there any way do overcome that. i tried to use Ajax updatepanel but it takes about 15 sec to show the combo.
|
|
|
|
|
Look into using the ASP.NET AJAX CascadingDropDown control extender.
|
|
|
|
|
will it overcome the delay problem in Ajax updatepanel ??
|
|
|
|
|
AJAX means that your page updates without postbacks.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Are you looking to load the data dynamically, or is it small enough that you can emit it to the browser?
UpdatePanels are fine if you know how to use them correctly. Slamming one over the entire page isn't always good. You should have it surround the dependent ComboBox and then trigger it based on the source combo box, so only the view state and code for the combo is round tripped.
There are two other methods that will work.
The first is to emit the list to the client and parse it - take a look at my blog post:
http://csharperimage.jeremylikness.com/2009/03/json-and-c-using-generics-and-delegates.html[^]
Basically, I serialize my objects using JSON and reconstruct them on the client, then when one combo box changes, I parse the appropriate sublist and dynamically the options for the second control. This is fast because there is no round trip to the server.
Finally, use a tool like Fiddler to examine your post going back and forth. 15 seconds is a long time so somewhere you have latency - whether its processing, network, database access, etc depends on many factors. If you wrapped the whole page in the update panel with viewstate turned on you could have a huge messae and you just need to wrap a smaller portion, which the AJAX extender will address.
You might event want to look at implementing ICallbackEventhandler and wiring up the call yourself to trim down the size of the payload. Essentially you bind to the onchange for the dropdown, then use WebForm_DoCallback to call back, parse out the new values, etc.
Jeremy Likness
http://csharperimage.jeremylikness.com/
|
|
|
|
|
I'll check the link. the updatepanel is only containing the three comboboxes and all of the have static access "no db access". all it suppose to do is show and hide the combos
|
|
|
|
|
I am working on some website for a company.......................... And our language(Amharic) is not supported in Operating systems on XP and lower versions........................... So I want the font to be displayed in every client computer when they open my website ............... So can you tell me how to work on it? Thank you
|
|
|
|
|
you need to use @font-face in your css file to define your font - which you will need to upload. Ensure you have permission to do so from the person who made the font.
|
|
|
|
|
ok. That is a good idea. But how am i going to do that. i.e i am a new for web page development. just i learned less than 1 and half month. any ways it doesnt matter..................... For example if i had a CSS called general.css and if the font name is GEEZE and all of them are in the same folder .................how am i gonna to do that as you said.................. One friend told me to use a link to the font in my site which installs the font when they click the link to that font................ But it will be hard to know whether the font has been installed or not before.......................
I hope you understand what i said and will come up with a nice suggestion . Thank you
|
|
|
|