简体   繁体   English

跳动显示所选数据

[英]Display the Selected Data With Jumbling

This is my C# code for Jumbling the data. 这是我的C#代码来处理数据。

protected void Button1_Click1(object sender, EventArgs e)    
{
    ScrambleData("dsafdsfsd");
}

public static string ScrambleData(string data)
{
    //string BaseAddress = "http://localhost/";
    string BaseAddress = "http://abcd/"; //Calling by Computer Name.
    string uri = "ScramblerService/Scrambler?value=" + data;
    string CompleteRequestURL = BaseAddress + uri;

    HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create(CompleteRequestURL);
    //webrequest.Method = "GET";

    webrequest.ContentType = "application/json";
    string result;

    using (WebResponse response = webrequest.GetResponse())
    {
        using (StreamReader reader = new StreamReader(response.GetResponseStream()))
        {
            result = reader.ReadToEnd();
            return result;
        }
    }
}

This is my Java Script code for User selected Data. 这是我针对用户所选数据的Java脚本代码。

<script type="text/javascript">

    function disp()
    {
        var txtArea = document.getElementById('MainContent_TextArea1');
        var start = txtArea.selectionStart;
        var finish = txtArea.selectionEnd;
        var sel = txtArea.value.substring(start, finish);
        document.getElementById("MainContent_Textarea2").value = sel;   
    }
</script>

<div>
    <asp:TextBox id="TextArea1" runat="server" TextMode="MultiLine" CssClass="form-control" Height="300px"></asp:TextBox>
    <INPUT type="button" onclick= "disp()" visible="true" value="Show" class="btn btn-primary"/>&nbsp;
    <input id="Textarea2" runat="server" type="text"/>
</div>

Here I am trying to display the user selected data. 在这里,我试图显示用户选择的数据。 While displaying the user selected data I need to jumble the words and has to display in Text area2. 在显示用户选择的数据时,我需要弄乱单词并必须在“文本”区域2中显示。 But I need to call this action through "Show" button Only. 但是我需要通过“仅显示”按钮来调用此操作。 Any Help Please..??? 任何帮助请.. ???
Any Suggestions Please...??? 任何建议请... ???

You are referencing an id of "MainContent_Textarea2" but you don't have any element with that ID. 您引用的ID为“ MainContent_Textarea2”,但没有任何具有该ID的元素。 You do, however, have one called "Textarea2", have you tried using that? 但是,您确实有一个名为“ Textarea2”的文件,您是否尝试过使用它?

document.getElementById("Textarea2").value = sel;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM