Can anyone guide me how to replace a word from sql using vb and ajax with clicking a button?
I tried this backend code:
Using da As New SqlDataAdapter
con.Open()
cmd.CommandText = "SELECT value_en as value FROM tbl_language WHERE element_id = 'a1';"
da.SelectCommand = cmd
Dim dt As New DataTable
da.Fill(dt)
Dim WordValue As String = dt.Rows(0).Item(0)
End Using
and in front end to display the word:
<%# Eval("WordValue")%>
My ajax:
$.ajax({
type: "POST",
cache: false,
url: "http://ift.tt/1JxB6gu",
data: {},
success: alert("success"),
error: alert("error")
});
Buttons to translate:
<form runat="server">
<asp:RadioButtonList ID="change_language" runat="server" AutoPostBack="True"
onselectedindexchanged="change_language_SelectedIndexChanged">
<asp:ListItem Selected="True" Value="english">English</asp:ListItem>
<asp:ListItem Value="malay">Malay</asp:ListItem>
</asp:RadioButtonList>
</form>
Aucun commentaire:
Enregistrer un commentaire