how to get limited text only from the textbox..

Posted by Nietajay under Regular Expressions on 6/17/2011 | Points: 10 | Views : 1348 | Status : [Member] | Replies : 1
hi ,

in url rewriting i am using this code for description..

its taking the full text from the textbox..

now how to get the limitedtext from the textbox for description..

this is my code ..

line.Replace("[MetaDes]", txtDes.Text.Replace('"', ' ').Replace('"', ' ').Replace('<', '-').Replace('>', '-') );

thankyou..:)

http://www.questionsofinterview.com

Ajay Kumar
Web developer



Responses

Posted by: Lakn2 on: 6/17/2011 [Member] Starter | Points: 25

Up
0
Down
try this

<script type="text/javascript">
function doselection()
{
if (window.getSelection)
{
txt = window.getSelection();
}
else if (document.getSelection)
{
txt = document.getSelection();
}
else if (document.selection)
{
txt = document.selection.createRange().text;
}
else
{
alert('selection not supported');
}
document.getElementById('<%=hidSelectedText.ClientID %>').value = txt;
}

</script>


<asp:TextBox runat="server" ID="txt1" TextMode="MultiLine" />

<asp:HiddenField runat="server" ID="hidSelectedText" />

<asp:Button runat="server" ID="showselected" Text="Show selected" OnClientClick="doselection();" OnClick="showselected_Click" />

Thanks&Regards
LakshmiNarayana Nalluri.

Nietajay, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response