i have issue with update command. So here is the thing. I want to make a XML translator. In left column one language and on the right side .. another language. When i click on edit button right side text transforms in to empty WYSIWYG text editor. After
i type text there i need to put typed text in to XML template, which is generated from original XML with filled elements. Original XML:
<?xml version="1.0" encoding="utf-8" ?>
<dataroot>
<index>
<key>global_header_country_name</key>
<text>
Lietuva
</text>
</index>
<index>
<key>index_new_information_box_sub_title_text1</key>
<text>
Lietuvoje elektronines sąskaitas faktūras reglamentuoja <a href="http://www3.lrs.lt/pls/inter3/dokpaieska.showdoc_l?p_id=389443" target="_blank">PVM įstatymas</a> bei VMI išleistos „Elektroninių pridėtinės vertės mokesčio sąskaitų faktūrų išrašymo, išsiuntimo ir saugojimo taisyklės“ <a href="http://www3.lrs.lt/pls/inter3/dokpaieska.showdoc_l?p_id=358040" target="_blank">VA-80</a>.
</text>
</index>
<index>
<key>recipients_page_description</key>
<text>
Paslaugos gavėjams - Elektroninės sąskaitos faktūros
</text>
</index>
<index>
<key>index_new_information_box_sub_title_text2</key>
<text>
Lietuvoje elektronines sąskaitas faktūras reglamentuoja <a href="http://www3.lrs.lt/pls/inter3/dokpaieska.showdoc_l?p_id=389443" target="_blank">PVM įstatymas</a> bei VMI išleistos „Elektroninių pridėtinės vertės mokesčio sąskaitų faktūrų išrašymo, išsiuntimo ir saugojimo taisyklės“ <a href="http://www3.lrs.lt/pls/inter3/dokpaieska.showdoc_l?p_id=358040" target="_blank">VA-80</a>.
</text>
</index>
</dataroot>
So as you can see everything stayd at theis places, only <text> </text> are empyt. This is the place where i need to put transladet text from Rich Text Editor to XML via DataGrid - update command.
I searched all over the internet for right example of update function for my situation. Maybe somebody can suggest something? Or explain me how it should work or provide some example ?
Probably it will be an easy one, but I`am just a beginner at asp .net
Daniil T.
Member
46 Points
32 Posts
Update XML entries in XML template via datagrid update command handler
Mar 16, 2012 12:46 AM|LINK
Hello everybody,
i have issue with update command. So here is the thing. I want to make a XML translator. In left column one language and on the right side .. another language. When i click on edit button right side text transforms in to empty WYSIWYG text editor. After i type text there i need to put typed text in to XML template, which is generated from original XML with filled elements.
Original XML:
<?xml version="1.0" encoding="utf-8" ?> <dataroot> <index> <key>global_header_country_name</key> <text> Lietuva </text> </index> <index> <key>index_new_information_box_sub_title_text1</key> <text> Lietuvoje elektronines sąskaitas faktūras reglamentuoja <a href="http://www3.lrs.lt/pls/inter3/dokpaieska.showdoc_l?p_id=389443" target="_blank">PVM įstatymas</a> bei VMI išleistos „Elektroninių pridėtinės vertės mokesčio sąskaitų faktūrų išrašymo, išsiuntimo ir saugojimo taisyklės“ <a href="http://www3.lrs.lt/pls/inter3/dokpaieska.showdoc_l?p_id=358040" target="_blank">VA-80</a>. </text> </index> <index> <key>recipients_page_description</key> <text> Paslaugos gavėjams - Elektroninės sąskaitos faktūros </text> </index> <index> <key>index_new_information_box_sub_title_text2</key> <text> Lietuvoje elektronines sąskaitas faktūras reglamentuoja <a href="http://www3.lrs.lt/pls/inter3/dokpaieska.showdoc_l?p_id=389443" target="_blank">PVM įstatymas</a> bei VMI išleistos „Elektroninių pridėtinės vertės mokesčio sąskaitų faktūrų išrašymo, išsiuntimo ir saugojimo taisyklės“ <a href="http://www3.lrs.lt/pls/inter3/dokpaieska.showdoc_l?p_id=358040" target="_blank">VA-80</a>. </text> </index> </dataroot>Generated XML:
<?xml version="1.0" encoding="utf-8"?> <dataroot> <index> <key>global_header_country_name</key> <text> </text> </index> <index> <key>index_new_information_box_sub_title_text1</key> <text> </text> </index> <index> <key>recipients_page_description</key> <text> </text> </index> <index> <key>index_new_information_box_sub_title_text2</key> <text> </text> </index> </dataroot>So as you can see everything stayd at theis places, only <text> </text> are empyt. This is the place where i need to put transladet text from Rich Text Editor to XML via DataGrid - update command.
I have data grid, it looks like this:
<asp:DataGrid ID="ItemsGrid" runat="server" AllowPaging="True" OnUpdateCommand="ItemsGrid_UpdateCommand" OnEditCommand="ItemsGrid_EditCommand" OnCancelCommand="ItemsGrid_CancelCommand" AllowCustomPaging="True" AutoGenerateColumns="False" > <Columns> <asp:EditCommandColumn EditText="Edit" CancelText="Cancel" UpdateText="Update" /> <asp:TemplateColumn ItemStyle-Width="435"> <ItemTemplate> <asp:Literal runat="server" ID="ItemsGrid_raktas" Text='<%# Eval("key")%>'></asp:Literal> </ItemTemplate> </asp:TemplateColumn> <asp:TemplateColumn ItemStyle-Width="435"> <ItemTemplate> <asp:Literal runat="server" ID="ItemsGrid_veciamas" Text='<%# Eval("text_source")%>'></asp:Literal> </ItemTemplate> <ItemStyle Width="435px"></ItemStyle> </asp:TemplateColumn> <asp:TemplateColumn> </asp:TemplateColumn> <asp:TemplateColumn ItemStyle-Width="565"> <ItemTemplate> <asp:Literal runat="server" ID="ItemsGrid_isverstas_Pasivus" Text='<%# Eval("text_destination") %>'></asp:Literal> </ItemTemplate> <EditItemTemplate> <FTB:FreeTextBox ID="tvarkykle" Text='<%# Eval("text_destination") %>' runat="server"> </FTB:FreeTextBox> </EditItemTemplate> <ItemStyle Width="565px"></ItemStyle> </asp:TemplateColumn> </Columns> <PagerStyle Mode="NumericPages" /> </asp:DataGrid>I searched all over the internet for right example of update function for my situation. Maybe somebody can suggest something? Or explain me how it should work or provide some example ?
Probably it will be an easy one, but I`am just a beginner at asp .net
Regards!