|
Hi,
Please can some one help me wit a Div tag issue? i hav a div tag
which is editable. I type in some data or text. And in between the text i focus to a point. Then create a hyperlink dynamically on a asp button click. I'm able to get the hyperlink in the Div tag but i want it placed in the focus point of the div tag from where i left last.
Thank You,
Sparkling Star
Sparkling Star
|
|
|
|
|
This link[^] may point you in the right direction.
|
|
|
|
|
Thank u for ur response but that is not wat i want. I want to place my hyperlink inside the div tag from the cursor position i left b4 clicking the button.
Regards
Sparkling Star
|
|
|
|
|
Focus applies for only editable items.
|
|
|
|
|
Hi
Can someone tell me what are the pros and cons of calling a web-service through JavaScript instead of calling a web-service through c# or vb.net???
Regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
<%@ WebService Language="VB" Class="Samples.AspNet.SimpleWebService" %>
Imports System.Web
Imports System.Web.Services
Imports System.Xml
Imports System.Web.Services.Protocols
Imports System.Web.Script.Services
Namespace Samples.AspNet
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ScriptService()> _
Public Class SimpleWebService
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function EchoInput(ByVal input As String) As String
Dim inputString As String = Server.HtmlEncode(input)
If Not String.IsNullOrEmpty(inputString) Then
Return String.Format("You entered {0}. The " + _
"current time is {1}.", inputString, DateTime.Now)
Else
Return "The input string was null or empty."
End If
End Function 'EchoInput
End Class 'SimpleWebService
End Namespace
This is asmx File and this is aspx file
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<style type="text/css">
body { font: 11pt Trebuchet MS;
font-color: #000000;
padding-top: 72px;
text-align: center }
.text { font: 8pt Trebuchet MS }
</style>
<title>Simple Web Service</title>
<script type="text/javascript">
// This function calls the Web Service method.
function EchoUserInput()
{
var echoElem = document.getElementById("EnteredValue");
Samples.AspNet.SimpleWebService.EchoInput(echoElem.value,
OnSucceeded);
}
|
|
|
|
|
Thanks to provide the code. But my question was to tell me the advantages as well as disadvantages of calling a web-service through JavaScript. If you know then please write them here.
Regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
Hmm, no postback?
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
You cant achieve this using javascript, you have to use AJAX for this purpose
Best Regards,
Haissam Abdul Malak
My Blog
|
|
|
|
|
AJAX stands for Asynchronous Javascript And XML, duh.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
Really?? how smart!!
u have said it ASYNCHRONOUS JAVASCRIPT, and the libraries used in ajax are not by default for javascript, please learn more and then post your comment.
DUHH
Best Regards,
Haissam Abdul Malak
My Blog
|
|
|
|
|
|
hi
I would like to know ,what is the code for the textbox(txtWeekNo) to display the week number automatically ,after the user selected the date from the calender,when the date is displayed in the txtdate.
olgam
|
|
|
|
|
Hi All,
I have a form in a page. There are two of customer of my website i-e End User and Business User. When User Login to my website he can change his information. When he click on Change User Info a form is visible to him where he can change his information. But that form opens on a certain condition. Like when he click on Change User Info, a query string is send to that form page. If He is End user 1 is send in query string to that form page if he is Business User 2 is send in query string. Now if he is end user there is a button "Upgrade to Business User". When he click On that button a popups open where he can upgrade him self. He will click on Save Button. When Save button is Clicked the parent page is refreshed. Now the Business user Form should be visible, but there is still the end user form, although page is refreshed. The reason is that there was 1 in query string. Now can any one tell me How can I do that, the query string of parent page change to 2. I refresh parent page with the help of this coding.
Dim sScript As New System.Text.StringBuilder
sScript.Append("<SCRIPT language=""javascript"">" & vbCrLf)
sScript.Append("parent.window.opener.location =parent.window.opener.location; window.self.close();" & vbCrLf)
sScript.Append("</SCRIPT>" & vbCrLf)
RegisterClientScriptBlock("ForceDefaultToScript", sScript.ToString)
Any Help regarding to this.
Thanks in Advance.
|
|
|
|
|
erhm...
I think the best way is to open the pop window with the existing querystring of your parent page
window.open('popup.aspx?querystring=1','window','windowproperties');
in popup.aspx you modify the querystring to a new querystring you want to refresh the parentpage with. Lets assume you want to change the value 1 into two...
Your stringbuilder looks like this than
<br />
Dim sScript As New System.Text.StringBuilder<br />
sScript.Append("<SCRIPT language=""javascript"">")<br />
sScript.Append(Environment.NewLine)<br />
sScript.Append("parent.window.opener.location = 'page.aspx?querystring=")<br />
sScript.Append("2") ' or any value you want<br />
sScript.Append("';")<br />
sScript.Append(Environment.NewLine)<br />
sScript.Append("window.self.close();")<br />
sScript.Append(Environment.NewLine)<br />
sScript.Append("</SCRIPT>")<br />
RegisterClientScriptBlock("ForceDefaultToScript", sScript.ToString)<br />
Note I also changed your newline characters into en environment.newline, this is just more neat... You also add the newline characters by appending the character using an ampersant ( "a"&"a" ) if you do so, your stringbuilder doesn't make sense... I changed the way the javascript is built in just a neater way... the result will be fearly the same except for the querystring part
|
|
|
|
|
I have put the following code in my sorce code
<asp:sqldatasource id="SqlDataSource1" runat="server" selectcommand="SELECT [FirstName],[LastName],[Occupation]from [Contractor]"
="" updatecommand="UPDATE [Contractor] SET [FirstName] = @FirstName,[LastName] = @LastName,[Occupation] = @Occupation where ContractorID = @ContractorID
ConnectionString=" <%$="ConnectionStrings:Pubs" %="">" />
I get the following error
The connection name 'Pubs' was not found in the applications configuration or the connection string is empty.
So my question is? Is Pubs the name of the database or table
karabo mekgwe
Ecom Institute
|
|
|
|
|
No, it should be the name of the entry in your configuration file that contains the connection string to get to Pubs.
|
|
|
|
|
i want to convert the MSword file into the html format so that browser can show the doc file data as a html content which is exactly similar to the doc data format.
Hiren Paerkh
|
|
|
|
|
|
I assume you've already tried saving it in HTML format
from inside of Word? Am I missing something?
|
|
|
|
|
Actually i want to show one doc file in the explorer and its showing the content in explorer by setting the contenttype="application/msword" but it shows the all the marginbars and toolbar of word and i want to display the plain text of the doc file in the same format as word but as a html content so can u suggest me the way how to make an equivallent html of doc file.
Hiren Paerkh
|
|
|
|
|
|
hello,
am a beginner in (programming)asp.net.And would like to know what is the code to display the name of the person login to the system on the next page(using session).
Name declared as UserName on the loig page,to be display on the Member textbox on the next page.
olgam
|
|
|
|
|
Hi,
If you want to use Session for this, you will need to do it this way
Just before you redirect the user to the next page, save the User Name(details) in the Session variable like Session["UserName"] = source of the data.
Then when the user redirects to the next page, fetch it back from the same session variable like TextBox.Text = Convert.ToString(Session["UserName"])
Thats it. and you shld be done with ur requirement.
Thanks and best regards
Omkar Ghaisas
|
|
|
|
|