This is a migrated thread and some comments may be shown as answers.

Very Urgent Problem

2 Answers 114 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
FEST
Top achievements
Rank 1
FEST asked on 06 Jul 2011, 01:43 PM
HI! im making a webpage with visual web developer express edition 2008 and i have been trying some radobjects. Every time i run de debbug i get an error on telerik.web.ui about some variables a, b ,c ,d ... that are undefined. I have no ideia what to do since i already unistalled telerik and reinstalled it. My version of telerik is 2011.1.519.35.
I would really appreciate the hlp because i'm really dependent of this.

asp file:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="PAbertura.aspx.vb" Inherits="Default3" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
<%@ Register assembly="Telerik.Web.UI, Version=2011.1.519.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" namespace="Telerik.Web.UI" tagprefix="telerik" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
    <style type="text/css">
        .Search
        {
            background-image:url('~/images/help.png');
        }
    </style>
  
</head>
<body runat="server">
<style type="text/css">
        .upload-panel
        {
            width: 300px;
        }
          
        .info-panel
        {
            display: none;
            margin-top: 15px;
        }
    </style>
  
<script type="text/javascript">
    function clientShow(sender, args)
    {
        var nome = $find("rcb_sinistrado");
        var some = nome.get_text() + "";
        if (some != "- Nome Sinistrado -" && some != "") {
            var nomeBase = $find("Sinistrado_rtb_nome");
            nomeBase.set_value(some);
        }
        RequestStart();
    }
  
    var currentLoadingPanel = null;
    var currentUpdatedControl = null;
    function RequestStart() {
        currentLoadingPanel = $find("RadAjaxLoadingPanel1");
        currentUpdatedControl = "Panel1";
        //show the loading panel over the updated control
        currentLoadingPanel.show(currentUpdatedControl);
    }
  
    function ComboToolTipHide() {
        var combo = $find("Sinistrado_rcb_nacionalidade");
        if( combo != null)
            combo.hideDropDown();
    }
  
    function DatePickerToolTipHide() {
        var picker = $find("Sinistrado_rdp_dtnascimento");
        if( picker != null)
            picker.hidePopup();
    }
  
    function ResponseEnd() {
        ComboToolTipHide();
        DatePickerToolTipHide();
        //hide the loading panel and clean up the global variables
        if (currentLoadingPanel != null)
            currentLoadingPanel.hide(currentUpdatedControl);
        currentUpdatedControl = null;
        currentLoadingPanel = null;
    }
  
    function fileUploaded(sender, args) {
        var name = args.get_fileName();
        var $ = $telerik.$;
  
        $(".info-panel").
                append($("<div>" + name + "</div>")).show();
    }
  
  
</script>
      
    <form id="form1" runat="server">
      
    <asp:SqlDataSource ID="clinicas" runat="server" 
        ConnectionString="<%$ ConnectionStrings:tester2 %>" 
        SelectCommand="SELECT [Nome], [Clinica_id] FROM [Clinicas]">
    </asp:SqlDataSource>
      
    <div style="z-index: 1; left: 1037px; top: 11px; position: absolute; height: 65px; width: 260px">
      
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
    </telerik:RadScriptManager>
    <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" 
            RelativeTo="Element" Skin="Windows7" AutoCloseDelay="0" 
            HideDelay="0" HideEvent="LeaveTargetAndToolTip" AutoTooltipify="True" 
            ToolTipZoneID="Panel1" 
            style="z-index: 1; left: 10px; top: 40px; position: absolute; height: 40px; width: 246px">
              
    </telerik:RadToolTipManager>
              
    </div>
  
      
  
      
      
        
        
       <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Width="238px" 
        MultiPageID="RadMultiPage1" SelectedIndex="0" Skin="WebBlue">
            <Tabs>
                <telerik:RadTab runat="server" Text="Dados" PageViewID="RadPageView1" 
                    Selected="True" Target="_top">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Documentos" Enabled="False">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
        <telerik:RadPageView ID="RadPageView1" runat="server" 
                  
                style="z-index: 1; left: 10px; top: 50px; position: absolute; height: 527px; width: 1449px" 
                Selected="True">
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
        Skin="Vista">
         
                  
         
      </telerik:RadAjaxLoadingPanel>
            <asp:Panel ID="Panel1" runat="server" 
              
          
                style="z-index: 1; left: 10px; top: 10px; position: absolute; height: 455px; width: 641px">
        <asp:Label ID="lb_processo" runat="server" 
        style="z-index: 1; left: 10px; top: 0px; position: absolute" 
        Text="Nº do Processo Interno"></asp:Label>
            <telerik:RadTextBox ID="rtb_processo" Runat="server" 
        EmptyMessage="- Nº Proceso Interno -" Skin="Outlook" 
        style="z-index: 1; left: 260px; top: 0px; position: absolute;" 
        Width="200px" AutoPostBack="True" ToolTip="Procure por um processo">
            </telerik:RadTextBox>
            <asp:Label ID="lb_sinistrado" runat="server" 
        style="z-index: 1; left: 10px; top: 30px; position: absolute" 
        Text="Sinistrado*"></asp:Label>
            <asp:Label ID="lb_tomador" runat="server" 
        style="z-index: 1; left: 10px; top: 60px; position: absolute" 
        Text="Tomador do Seguro - Segurado"></asp:Label>
            <asp:Label ID="lb_apolice" runat="server" 
        style="z-index: 1; left: 10px; top: 90px; position: absolute" Text="Apólice*"></asp:Label>
            <telerik:RadMaskedTextBox ID="rmtb_apolice" Runat="server" Mask="####-######" 
        Skin="Outlook" 
        style="z-index: 1; left: 260px; top: 90px; position: absolute" 
        Width="150px" ResetCaretOnFocus="True" SelectionOnFocus="CaretToBeginning">
            </telerik:RadMaskedTextBox>
                <asp:CheckBox ID="cb_ns_apolice" runat="server" 
                    style="z-index: 1; left: 420px; top: 90px; position: absolute" Text="NS" 
                    ToolTip="Em caso de não saber a apólice" AutoPostBack="True"  />
                    <asp:CheckBox ID="cb_ns_proceso" runat="server" 
                    style="z-index: 1; left: 420px; top: 150px; position: absolute" Text="NS" 
                    ToolTip="Em caso de não saber o processo" AutoPostBack="True"  />
            <asp:ImageButton ID="img_search_proceso" runat="server" ImageUrl="~/images/search16_1.png" 
                    style="z-index: 1; left: 480px; top: 3px; position: absolute; width: 16px;" 
                    ToolTip="Procure por um processo" />
            <asp:ImageButton ID="img_search_sinistrado" runat="server" ImageUrl="~/images/search16_1.png" 
                    style="z-index: 1; left: 480px; top: 33px; position: absolute; height: 16px;" 
                    ToolTip="Visualize os dados do sinistrado" />
                    <asp:ImageButton ID="img_search_segurado" runat="server" ImageUrl="~/images/search16_1.png" 
                    style="z-index: 1; left: 480px; top: 63px; position: absolute; height: 16px;" 
                    ToolTip="Pesquisar processos por segurado" />
                <asp:ImageButton ID="img_search_apolice" runat="server" ImageUrl="~/images/search16_1.png" 
                    style="z-index: 1; left: 480px; top: 93px; position: absolute" 
                    ToolTip="Pesquisar processos por apólice" />
            <asp:Label ID="lb_datasinistro" runat="server" 
        style="z-index: 1; left: 10px; top: 120px; position: absolute" 
        Text="Data do Sinistro*"></asp:Label>
            <telerik:RadDateTimePicker ID="rdtp_datasinistro" Runat="server" 
        Skin="Outlook" 
        style="z-index: 1; left: 260px; top: 120px; position: absolute" 
        ToolTip="Data do Acidente" Width="200px" EnableTyping="False">
                <Calendar ID="Calendar1" runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" 
            ViewSelectorText="x" Skin="Outlook">
                </Calendar>
                <TimeView ID="TimeView1" runat="server" CellSpacing="-1" Culture="Portuguese (Portugal)">
                </TimeView>
                <TimePopupButton ImageUrl="" HoverImageUrl="">
                </TimePopupButton>
                <DatePopupButton ImageUrl="" HoverImageUrl="">
                </DatePopupButton>
                <DateInput ID="DateInput1" runat="server" DisplayDateFormat="dd-MM-yyyy" 
                    DateFormat="dd-MM-yyyy" ReadOnly="True">
                </DateInput>
            </telerik:RadDateTimePicker>
            <asp:Label ID="lb_procesocomapnhia" runat="server" 
        style="z-index: 1; left: 10px; top: 150px; position: absolute" 
        Text="Nº do Processo da companhia*"></asp:Label>
            <telerik:RadMaskedTextBox ID="rmtb_procesocompanhia" Runat="server" Mask="####-###-####-####" 
        Skin="Outlook" style="z-index: 1; left: 260px; top: 150px; position: absolute" 
        Width="150px" SelectionOnFocus="CaretToBeginning" TextWithLiterals="---">
            </telerik:RadMaskedTextBox>
            <telerik:RadComboBox ID="rcb_tomador" Runat="server" Skin="Outlook" 
        style="z-index: 4; left: 260px; top: 60px; position: absolute" 
        EmptyMessage="- Nome Segurado -" Width="200px" AllowCustomText="True" 
        AutoCompleteSeparator="|" Filter="Contains" MarkFirstMatch="True" 
                    ToolTip="Procure por um segurado" DataSourceID="segurado" 
                    DataTextField="Empresa" DataValueField="Tomadores_Id" 
                EnableAutomaticLoadOnDemand="True" ItemsPerRequest="20" 
                LoadingMessage="A carregar..." ShowMoreResultsBox="True">
                <localization nomatches="Sem correspondencias!" />
            </telerik:RadComboBox>
                <asp:SqlDataSource ID="segurado" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:tester2 %>" 
                    SelectCommand="SELECT [Empresa], [Tomadores_Id] FROM [Tomadores_Seguro]">
                </asp:SqlDataSource>
            <telerik:RadComboBox ID="rcb_sinistrado" Runat="server" Skin="Outlook" 
        style="z-index: 5; left: 260px; top: 30px; position: absolute; right: 183px;" 
        EmptyMessage="- Nome Sinistrado -" Width="200px" AllowCustomText="True" 
        AutoCompleteSeparator="|" Filter="Contains" MarkFirstMatch="True" 
        ZIndex="6001" DataSourceID="sinistrado" DataTextField="Sinistrado" 
        DataValueField="Sinistrado_ID" ToolTip="Nome do sinistrado" 
                EnableAutomaticLoadOnDemand="True" ItemsPerRequest="20" 
                Culture="Portuguese (Portugal)" LoadingMessage="A carregar..." 
                ShowMoreResultsBox="True">
                <localization nomatches="Sem correspondencias!" />
            </telerik:RadComboBox>
                <asp:SqlDataSource ID="sinistrado" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:tester2 %>" 
                    SelectCommand="SELECT [Sinistrado], [Sinistrado_ID] FROM [Sinistrados]">
                </asp:SqlDataSource>
            <telerik:RadTextBox ID="RadTextBox2" Runat="server" 
        style="z-index: 1; left: 480px; top: 150px; position: absolute" 
        EmptyMessage="- Tipo Processos -" Skin="Web20" ToolTip="Tipo de Processo" 
        Width="70px">
            </telerik:RadTextBox>
            <asp:Label ID="lb_estado" runat="server" 
        style="z-index: 1; left: 10px; top: 180px; position: absolute" 
        Text="Estado do Processo*"></asp:Label>
                <asp:RadioButton ID="rb_condicional" runat="server" GroupName="estado" 
                    style="z-index: 1; left: 260px; top: 180px; position: absolute" 
                    Text="Condicional" />
                <asp:RadioButton ID="rb_definitivo" runat="server" GroupName="estado" 
                    style="z-index: 1; left: 380px; top: 180px; position: absolute" 
                    Text="Definitivo" />
                <asp:CheckBox ID="cb_recaida" runat="server" 
                    style="z-index: 1; left: 480px; top: 180px; position: absolute" 
                    Text="Recaida?" ToolTip="Apenas para processos que não são novos" />
            <asp:Label ID="lb_produto" runat="server" 
        style="z-index: 1; left: 10px; top: 210px; position: absolute" 
        Text="Produto"></asp:Label>
            <telerik:RadTextBox ID="rtb_produto" Runat="server" EmptyMessage="- Produto -" 
        style="z-index: 1; left: 260px; top: 210px; position: absolute" 
        Width="200px" Enabled="False">
            </telerik:RadTextBox>
            <asp:Label ID="lb_ramo" runat="server" 
        style="z-index: 1; left: 10px; top: 240px; position: absolute" Text="Ramo"></asp:Label>
            <telerik:RadTextBox ID="rtb_posramos" Runat="server" 
        style="z-index: 1; left: 390px; top: 240px; position: absolute" 
        Enabled="False">
            </telerik:RadTextBox>
            <telerik:RadTextBox ID="rtb_preramo" Runat="server" 
        style="z-index: 1; left: 260px; top: 240px; position: absolute" 
        Enabled="False">
            </telerik:RadTextBox>
            <asp:CheckBox ID="cb_fechado" runat="server" 
          
        style="z-index: 1; left: 329px; top: 270px; position: absolute; width: 79px;" 
        Text="Fechado" />
            <asp:CheckBox ID="cb_visto" runat="server" 
        style="z-index: 1; left: 260px; top: 270px; position: absolute" 
        Text="Visto" />
            <asp:Label ID="lb_medico" runat="server" 
        style="z-index: 1; left: 10px; top: 300px; position: absolute" 
        Text="Médico Assistente*"></asp:Label>
            <telerik:RadComboBox ID="rcb_medico" Runat="server" Skin="Outlook" 
        style="z-index: 9; left: 260px; top: 300px; position: absolute" 
        AllowCustomText="True" AutoCompleteSeparator="|" Filter="Contains" 
        MarkFirstMatch="True" Width="200px" ToolTip="Escolha o médico assistente" 
                DataSourceID="medicos" DataTextField="Medico" DataValueField="Medico_id" 
                ZIndex="6010">
            </telerik:RadComboBox>
                <asp:SqlDataSource ID="medicos" runat="server" 
                ConnectionString="<%$ ConnectionStrings:tester2 %>" 
                SelectCommand="SELECT [Medico], [Medico_id], [Clinica] FROM [Medicos]">
                </asp:SqlDataSource>
            <asp:Label ID="lb_origem" runat="server" 
        style="z-index: 1; left: 10px; top: 330px; position: absolute" 
        Text="Origem do Sinistrado"></asp:Label>
            <telerik:RadTextBox ID="rtb_origem" Runat="server" 
        EmptyMessage="- Origem do Sinistrado -" Skin="Outlook" 
        style="z-index: 1; left: 260px; top: 330px; position: absolute" 
        Width="200px" ToolTip="Escreva a instituição de origem">
            </telerik:RadTextBox>
            <asp:Label ID="lb_procesoclinica" runat="server" 
        style="z-index: 1; left: 10px; top: 360px; position: absolute" 
        Text="Nº do Processo na Clínica"></asp:Label>
            <telerik:RadTextBox ID="rtb_processoclinica" Runat="server" 
        EmptyMessage="- Nº do Processo na Clínica -" 
        style="z-index: 1; left: 260px; top: 360px; position: absolute; bottom: 117px;" 
        Width="200px" Skin="Outlook" ButtonCssClass="Search" 
                EnableAjaxSkinRendering="False" EnableEmbeddedBaseStylesheet="False" 
                EnableEmbeddedScripts="False" EnableEmbeddedSkins="False">
            </telerik:RadTextBox>
            <asp:ImageButton ID="img_search_clinica" runat="server" ImageUrl="~/images/search16_1.png" 
                    style="z-index: 1; left: 480px; top: 363px; position: absolute" 
                    ToolTip="Pesquisar processos por nº processo da clínica" />
            <asp:Label ID="lb_gestor" runat="server" 
        style="z-index: 1; left: 10px; top: 390px; position: absolute" 
        Text="Gestor do Processo*"></asp:Label>
            <telerik:RadComboBox ID="rcb_gestor" Runat="server" Skin="Outlook" 
        style="z-index: 8; left: 260px; top: 390px; position: absolute" 
        AllowCustomText="True" AutoCompleteSeparator="|" 
        DataTextField="Capítulos_e_Subcapítulos" 
        DataValueField="ID_Capitulo_Subcapítulo" Filter="Contains" 
        MarkFirstMatch="True" Width="200px" ZIndex="6009" 
                    ToolTip="Indique o gestor do processo">
            </telerik:RadComboBox>
            <telerik:RadButton ID="rb_novo_proceso" runat="server" Skin="Outlook" 
        style="z-index: 1; left: 130px; top: 420px; position: absolute" 
        Text="Guardar como novo processo" Width="200px">
            </telerik:RadButton>
              
            <telerik:RadButton ID="rb_alterar_proceso" runat="server" Skin="Outlook" 
        style="z-index: 1; left: 350px; top: 420px; position: absolute" 
        Text="Guardar Alterações" Width="150px">
            </telerik:RadButton>
            <asp:Button ID="b_sinistrado" runat="server" 
        style="z-index: 1; left: 520px; top: 30px; position: absolute; width: 110px;" 
            Text="Novo Sinistrado" ToolTip="Crie um novo Sinistrado" 
                    onclientclick="clientShow" />
                      
        <asp:Button ID="Button1" runat="server" 
        style="z-index: 1; left: 640px; top: 30px; position: absolute; width: 110px;" 
            Text="Visualizar dados" ToolTip="Visualizar dados" 
                    onclientclick="clientShow" />
        <asp:Image ID="erro_apolice" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 230px; top: 93px; position: absolute; height: 16px;" 
                    ToolTip="Apenas números e todos os espaços preenchidos" Visible="False" />
        <asp:Image ID="erro_nome_sinistrado" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 230px; top: 33px; position: absolute; height: 16px;" 
                    ToolTip="Não introduza números nem acentos." Visible="False" />
        <asp:Image ID="erro_tomador" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 230px; top: 33px; position: absolute; height: 16px;" 
                    ToolTip="Campo vazio" Visible="False" />                        
        <asp:Image ID="erro_proceso_interno" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 230px; top: 3px; position: absolute; height: 16px;" 
                    ToolTip="Só pode conter números" Visible="False" />
        <asp:Image ID="erro_data_sinistro" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 230px; top: 123px; position: absolute; height: 16px;" 
                    ToolTip="Data inválida ou vazia" Visible="False" /> 
        <asp:Image ID="erro_processo_companhia" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 230px; top: 153px; position: absolute; height: 16px;" 
                    ToolTip="Apenas números e todos os espaços preenchidos" Visible="False" />            
        <asp:Image ID="erro_recaida" runat="server" ImageUrl="~/images/Error_24.png" 
                      
                    style="z-index: 1; left: 230px; top: 183px; position: absolute; height: 16px;" 
                    Visible="False" />
        <asp:Image ID="Image12" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 230px; top: 213px; position: absolute; height: 16px;" 
                    ToolTip="Pesquisar Apólice" Visible="False" />
        <asp:Image ID="Image13" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 230px; top: 243px; position: absolute; height: 16px;" 
                    ToolTip="Pesquisar Apólice" Visible="False" />
        <asp:Image ID="Image14" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 230px; top: 273px; position: absolute; height: 16px;" 
                    ToolTip="Pesquisar Apólice" Visible="False" />
        <asp:Image ID="erro_medico" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 230px; top: 303px; position: absolute; height: 16px;" 
                    ToolTip="Tem de ter médico assistente" Visible="False" />
        <asp:Image ID="Image16" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 230px; top: 333px; position: absolute; height: 16px;" 
                    ToolTip="Pesquisar Apólice" Visible="False" />
        <asp:Image ID="erro_proceso_clinica" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 230px; top: 363px; position: absolute; height: 16px;" 
                    ToolTip="Pesquisar Apólice" Visible="False" />                                                            
        <asp:Image ID="erro_gestor" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 230px; top: 393px; position: absolute; height: 16px;" 
                    ToolTip="Tem de associar um gestor ao processo" Visible="False" />
                      
                      
                      
                    <!--<telerik:RadGrid runat="server"
                style="z-index: 1; left: 10px; top: 450px; position: absolute" 
                CellSpacing="0" DataSourceID="processos" 
                GridLines="None" ID="rg_processos" AutoGenerateColumns="False">
                    <headercontextmenu cssclass="GridContextMenu GridContextMenu_Default">
                    </headercontextmenu>
                    <mastertableview 
                datasourceid="processos">
                        <commanditemsettings exporttopdftext="Export to PDF" />
                        <rowindicatorcolumn 
                filtercontrolalttext="Filter RowIndicator column">
                            <HeaderStyle Width="20px" />
                        </rowindicatorcolumn>
                        <expandcollapsecolumn 
                filtercontrolalttext="Filter ExpandColumn column">
                            <HeaderStyle Width="20px" />
                        </expandcollapsecolumn>
                          
                        <Columns>
                            <telerik:GridClientSelectColumn ButtonType="ImageButton" 
                                FilterControlAltText="Filter column1 column" 
                                ImageUrl="~/images/select_16_mouse.png" Text="Seleccionar" UniqueName="column1">
                            </telerik:GridClientSelectColumn>
                            <telerik:GridBoundColumn DataField="Sinistrado_ID" DataType="System.Int32" 
                                FilterControlAltText="Filter Sinistrado_ID column" 
                                HeaderText="Sinistrado_ID" SortExpression="Sinistrado_ID" 
                                UniqueName="Sinistrado_ID">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Data_sinistro" DataType="System.DateTime" 
                                FilterControlAltText="Filter Data_sinistro column" HeaderText="Data_sinistro" 
                                SortExpression="Data_sinistro" UniqueName="Data_sinistro">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Nome" 
                                FilterControlAltText="Filter Nome column" HeaderText="Criado/Alterado" 
                                SortExpression="Nome" UniqueName="Nome">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="quando" DataType="System.DateTime" 
                                FilterControlAltText="Filter quando column" HeaderText="Criado/Alterado" 
                                SortExpression="quando" UniqueName="quando">
                            </telerik:GridBoundColumn>
                        </Columns>
                        <editformsettings>
                            <editcolumn 
                filtercontrolalttext="Filter EditCommandColumn column">
                            </editcolumn>
                        </editformsettings>
                    </mastertableview>
                    <clientsettings>
                        <selecting allowrowselect="True" />
                    </clientsettings>
                    <filtermenu enableimagesprites="False">
                    </filtermenu>
                </telerik:RadGrid>-->
          
                <asp:SqlDataSource ID="processos" runat="server" 
                ConnectionString="<%$ ConnectionStrings:tester2 %>" 
                  
                SelectCommand="SELECT Boletins.Boletim_id, Sinistros.Data_sinistro, Users.Nome, Boletins.quando FROM Boletins LEFT OUTER JOIN Users ON Boletins.quem = Users.Users_ID LEFT OUTER JOIN Sinistros ON Boletins.Sinistro_ID = Sinistros.Sinistros_ID">
                </asp:SqlDataSource>
          
                <!--<asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
                AutoGenerateColumns="False" DataKeyNames="Boletim_id" DataSourceID="processos" 
                style="z-index: 1; left: 10px; top: 450px; position: absolute; height: 133px; width: 598px">
                    <Columns>
                        <asp:CommandField ButtonType="Image" HeaderText="Seleccionar" 
                            SelectImageUrl="~/images/select_16_mouse.png" ShowSelectButton="True" />
                        <asp:BoundField DataField="Boletim_id" HeaderText="Nº Processo Interno" 
                            InsertVisible="False" ReadOnly="True" SortExpression="Boletim_id" />
                        <asp:BoundField DataField="Data_sinistro" HeaderText="Data Sinistro" 
                            SortExpression="Data_sinistro" />
                        <asp:BoundField DataField="Nome" HeaderText="Criado/Alterado" 
                            SortExpression="Nome" />
                        <asp:BoundField DataField="quando" HeaderText="Criado/Alterado" 
                            SortExpression="quando" />
                    </Columns>
                </asp:GridView>-->
          
        </asp:Panel>
    
    
    <telerik:RadToolTip ID="novoSinistrado" runat="server" Animation="FlyIn" 
        ManualClose="True" Position="TopCenter" 
        RelativeTo="BrowserWindow" ShowCallout="False" ShowEvent="FromCode" Skin="Web20" 
        style="z-index: 100; left: 959px; top: 78px; position: absolute;" Title="Novo Sinistrado" 
        Height="500px" Width="500px" OffsetX="30" OffsetY="100" 
                onclientbeforeshow="clientShow" onclientbeforehide="ResponseEnd">
        <asp:Panel runat="server" ID="sinis" Height="429px">
            <asp:Label ID="Sinistrado_lb_nome" runat="server" 
                style="z-index: 1; left: 10px; top: 30px; position: absolute" Text="Nome">
            </asp:Label>
            <asp:Label ID="Sinistrado_lb_morada" runat="server" 
                style="z-index: 1; left: 10px; top: 60px; position: absolute" Text="Morada">
            </asp:Label>
            <asp:Label ID="Sinistrado_lb_localidade" runat="server" 
                style="z-index: 1; left: 10px; top: 90px; position: absolute" Text="Localidade">
            </asp:Label>
            <asp:Label ID="Sinistrado_lb_codigo" runat="server" 
                style="z-index: 1; left: 10px; top: 120px; position: absolute" Text="Código Postal">
            </asp:Label>
            <asp:Label ID="Sinistrado_lb_telefone" runat="server" 
                style="z-index: 1; left: 10px; top: 150px; position: absolute" Text="Telefone">
            </asp:Label>
            <asp:Label ID="Sinistrado_lb_nacionalidade" runat="server" 
                style="z-index: 1; left: 10px; top: 180px; position: absolute" Text="Nacionalidade">
            </asp:Label>
            <asp:Label ID="Sinistrado_lb_sexo" runat="server" 
                style="z-index: 1; left: 10px; top: 210px; position: absolute" Text="Sexo">
            </asp:Label>
            <asp:Label ID="Sinistrado_lb_nascimento" runat="server" 
                style="z-index: 1; left: 10px; top: 240px; position: absolute" Text="Data Nascimento">
            </asp:Label>
            <asp:Label ID="Label22" runat="server" 
                style="z-index: 1; left: 10px; top: 270px; position: absolute" Text="Nº Contribuinte">
            </asp:Label>
            <asp:Label ID="Label23" runat="server" ForeColor="#999999" 
                style="z-index: 1; left: 10px; top: 330px; position: absolute" Text="Criado/Alterado por:">
            </asp:Label>
            <asp:Label ID="Label24" runat="server" ForeColor="#999999" 
                style="z-index: 1; left: 10px; top: 360px; position: absolute" Text="Quando">
            </asp:Label>
            <telerik:RadTextBox ID="Sinistrado_rtb_nome" Runat="server" 
                EmptyMessage="- Insira o nome -" 
                style="z-index: 1; left: 120px; top: 30px; position: absolute" 
                Width="200px">
            </telerik:RadTextBox>
            <asp:Image ID="Sinistrado_erro_nome" runat="server" ImageUrl="~/images/Error_24.png" 
                      
                style="z-index: 1; left: 330px; top: 30px; position: absolute; height: 16px;" 
                Visible="False" />
            <telerik:RadTextBox ID="Sinistrado_rtb_morada" Runat="server" 
                EmptyMessage="- Insira a morada -" 
                style="z-index: 1; left: 120px; top: 60px; position: absolute" 
                Width="200px">
            </telerik:RadTextBox>
            <asp:Image ID="Sinistrado_erro_morada" runat="server" ImageUrl="~/images/Error_24.png" 
                      
                style="z-index: 1; left: 330px; top: 60px; position: absolute; height: 16px;" 
                Visible="False" />
            <telerik:RadTextBox ID="Sinistrado_rtb_localidade" Runat="server" 
                EmptyMessage="- Insira a localidade -" 
                style="z-index: 1; left: 120px; top: 90px; position: absolute" 
                Width="200px">
            </telerik:RadTextBox>
            <asp:Image ID="Sinistrado_erro_localidade" runat="server" ImageUrl="~/images/Error_24.png" 
                      
                style="z-index: 1; left: 330px; top: 90px; position: absolute; height: 16px; width: 16px;" 
                Visible="False" />
            <telerik:RadComboBox ID="Sinistrado_rcb_nacionalidade" Runat="server" 
                style="z-index: 1002; left: 120px; top: 180px; position: absolute" DataTextField="Nacionalidade" 
                DataValueField="Natural_id" Width="200px" AllowCustomText="True" 
                AutoCompleteSeparator="|" DataSourceID="nacionalidade">
            </telerik:RadComboBox>
            <asp:SqlDataSource ID="nacionalidade" runat="server" 
                ConnectionString="<%$ ConnectionStrings:tester2 %>" 
                SelectCommand="SELECT [Nacionalidade], [Natural_id] FROM [Nacionalidades]">
            </asp:SqlDataSource>
            <asp:Image ID="Sinistrado_erro_nacionalidade" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 330px; top: 180px; position: absolute; height: 16px;" 
                    Visible="False" />
            <telerik:RadMaskedTextBox ID="Sinistrado_rmb_ncontribuinte" Runat="server" 
                style="z-index: 1; left: 120px; top: 270px; position: absolute" 
                Mask="#########" Width="200px">
            </telerik:RadMaskedTextBox>
            <asp:Image ID="Sinistrado_erro_ncontribuinte" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 330px; top: 270px; position: absolute; height: 16px;" 
                    Visible="False" />
            <telerik:RadMaskedTextBox ID="Sinistrado_rmb_telefone" Runat="server" 
                style="z-index: 1; left: 120px; top: 150px; position: absolute" 
                Mask="#########" Width="200px">
            </telerik:RadMaskedTextBox>
            <asp:Image ID="Sinistrado_erro_contacto" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 330px; top: 150px; position: absolute; height: 16px;" 
                    Visible="False" />            
            <telerik:RadMaskedTextBox ID="Sinistrado_rmb_codigo" Runat="server" 
                style="z-index: 1; left: 120px; top: 120px; position: absolute" 
                Mask="####-###" Width="200px" >
            </telerik:RadMaskedTextBox>
            <asp:Image ID="Sinistrado_erro_cp" runat="server" ImageUrl="~/images/Error_24.png" 
                      
                style="z-index: 1; left: 330px; top: 120px; position: absolute; height: 16px;" 
                Visible="False" />            
            <asp:RadioButton ID="Sinistrado_rb_f" runat="server" 
                style="z-index: 1; left: 240px; top: 210px; position: absolute" 
                Text="Feminino" GroupName="1" />
            <asp:Image ID="Sinistrado_erro_sexo" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 330px; top: 210px; position: absolute; height: 16px;" 
                    Visible="False" />                
            <asp:RadioButton ID="Sinistrado_rb_m" runat="server" 
                style="z-index: 1; left: 120px; top: 210px; position: absolute" 
                Text="Masculino" GroupName="1" />
            <telerik:RadDatePicker ID="Sinistrado_rdp_dtnascimento" Runat="server" 
                    style="z-index: 1001; left: 120px; top: 240px; position: absolute" 
                    Width="200px" Culture="Portuguese (Portugal)" MinDate="1900-01-01">
                <Calendar ID="Calendar2" runat="server" 
                    UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x">
                </Calendar>
                <DatePopupButton ImageUrl="" HoverImageUrl="" ToolTip="">
                </DatePopupButton>
                <DateInput ID="DateInput2" runat="server" 
                    DisplayDateFormat="dd-MM-yyyy" DateFormat="dd-MM-yyyy">
                </DateInput>
            </telerik:RadDatePicker>
            <asp:Image ID="Sinistrado_erro_datanascimento" runat="server" ImageUrl="~/images/Error_24.png" 
                    style="z-index: 1; left: 330px; top: 240px; position: absolute; height: 16px;" 
                    Visible="False" />            
            <asp:Label ID="Sinistrado_lb_quando" runat="server" 
                style="z-index: 1; left: 151px; top: 360px; position: absolute; width: 169px;" 
                Text="Label"></asp:Label>
            <asp:Label ID="Sinistrado_lb_quem" runat="server" 
                style="z-index: 1; left: 151px; top: 330px; position: absolute; width: 169px;" 
                Text="Label"></asp:Label>
            <telerik:RadButton ID="RadButton2" runat="server" 
                style="z-index: 1; left: 131px; top: 404px; position: absolute" 
                Text="Salvar">
            </telerik:RadButton>
       </asp:Panel>
    </telerik:RadToolTip>
      
   <telerik:RadToolTip ID="rtt_info_on_error" runat="server" Animation="Slide" 
                    HideEvent="ManualClose" Position="BottomRight" RelativeTo="BrowserWindow" 
                    ShowEvent="FromCode" 
                    style="z-index: 1; left: 700px; top: 178px; position: absolute; height: 149px; width: 366px" 
                    Title="Informação" Visible="False" ShowCallout="False" Skin="Windows7" 
                HideDelay="0">
                    <p>
                    Campos que estejam sinalizados com 
        <img src="images/Error_24.png" runat="server"/>
                    tem problemas.
                    Para saber qual, basta sobrepor o cursor sobre a imagem.</p>
                    <p>
                    Processos novos não podem ter o campo "Recaida?" marcado, pois este campo serve apenas para processos em que o sinistrado teve alta mas voltou a solicitar apoio.
                    </p>
                    <p>
                    Para criar um processo é necesário saber ou a apólice ou o número do proceso da companhia.
                    </p>
                    <p>
                    A data do sinistro diz respeito à data do acidente
                    </p>
                    <p>
                    Campos que tenham * são campos de preenchimento obrigatório
                    </p>
                    <p>
                    Para criar um proceso para um sinistrado é necesário que ele exista no sistema. Para introduzir um novo basta clicar no botão "Novo Sinistrado" onde poderá preencher os dados relativos.
                    </p>
                </telerik:RadToolTip>
            </telerik:RadPageView>
            <!--<telerik:RadPageView ID="RadPageView2" runat="server" 
                style="z-index: 1; left: 10px; top: 150px; position: absolute; height: 455px; width: 614px">
                <asp:Panel ID="Panel2" runat="server" 
                    style="z-index: 1; left: 10px; top: 50px; position: absolute; height: 455px; width: 614px">
  
           <telerik:RadUpload  
                                ID="RadUpload1" runat="server" 
                                MaxFileInputsCount="5"
                                OverwriteExistingFiles="false" 
                                Filter="PDF (*.pdf)|*.pdf" index = 1 Skin="Windows7"/>
                    <telerik:RadButton ID="Upload" runat="server" Skin="Windows7" Text="Submit">
                    </telerik:RadButton>
                    <br>
                    <br></br>
                    <asp:ListBox ID="ListBox1" runat="server" AutoPostBack="True" Height="316px" 
                        Width="591px"></asp:ListBox>
</br>
  
                </asp:Panel>  
            </telerik:RadPageView>-->
        </telerik:RadMultiPage>
          
    </form>
</body>
</html>


VB file:
Imports Telerik.Web.UI
Imports System.IO
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Data
Imports System.Net
  
Partial Class Default3
    Inherits System.Web.UI.Page
  
    Private Const gravado As String = "Gravado"
    Private Const n_gravado As String = "Não Gravado"
    Private Const pasta_pdf As String = "docs"
    Private valido_dados_processo As Boolean = True
    Private valido_dados_sinistrado As Boolean = False
    Private Const novo_proceso As Integer = 0
    Private Const grava_proceso As Integer = 1
    Private Const erro_est As String = "O processo tem de ser condicional ou definitivo"
    Private Const erro_rec As String = "Opção recaida não se aplica a novos processos"
    Private Const erro_sin_nome As String = "Não introduza números nem acentos."
    Private Const break_line As String = vbCrLf
    Private Const selectCommand_proceso_grid As String = "SELECT Boletins.Boletim_id, Sinistros.Data_sinistro, Users.Nome, Boletins.quando FROM Boletins LEFT OUTER JOIN Users ON Boletins.quem = Users.Users_ID LEFT OUTER JOIN Sinistros ON Boletins.Sinistro_ID = Sinistros.Sinistros_ID"
    Private Const selectCommand_proceso_dados As String = "SELECT Boletins.Sinistrado_ID, Boletins.Tomador_ID, Boletins.Apolice, Sinistros.Data_sinistro, Boletins.Comp_Processo, Boletins.Definitivo, Boletins.Recaida," & _
                                                          " Boletins.Produto, Boletins.Ramo, Boletins.Visto, Boletins.Fechado, Boletins.Medico_ID, Boletins.Origem_Sinistrado, Boletins.N_ProcClin, Boletins.Gestor" & _
                                                          " FROM Boletins LEFT OUTER JOIN Sinistros ON Boletins.Sinistro_ID = Sinistros.Sinistros_ID"
  
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  
        '// TRATA DOS DADOS QUE APARECEM EM rcb_medicos CONFORME O ID_CLINICA DO UILIZADOR
        'If IsNumeric() Then
        '    medicos.SelectCommand = "SELECT [Medico], [Medico_id], [Clinica] FROM [Medicos] WHERE Clinica = " & 
        'rcb_medico.DataBind()
        'End If
  
        processos.SelectCommand = ""
        GridView1.DataBind()
        'rg_processos.DataBind()
    End Sub
    Protected Sub RadButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadButton2.Click
        If Valido_Dados_Sinistrados() = True Then
        Else
  
        End If
        rcb_sinistrado.Text = Sinistrado_rtb_nome.Text.ToString
        novoSinistrado.Show()
    End Sub
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Upload.Click
        For Each f As UploadedFile In RadUpload1.UploadedFiles()
            'f.SaveAs(Server.MapPath("docs") & f.GetName, True)
  
            Dim nome_temp As String = ""
            Dim pasta As String = Server.MapPath(pasta_pdf) & "\"
            If Ve_Tipo_Ficheiro(pasta, f) Then 'se for pdf
                Dim Ext1 As String = System.IO.Path.GetExtension(f.FileName)
                Dim nome_Original As String = New FileInfo(f.FileName).Name
                Dim x As Integer = Len(nome_Original)
                Dim y As Integer = 0
                y = InStrRev(nome_Original, Ext1, x)
                nome_Original = Mid(nome_Original, 1, y - 1)
                nome_Original = Replace(nome_Original, "%", "")
  
                Dim nome_ficheiro As String = "" 'Label205.Text
                Dim pasta_ficheiro As String = pasta & nome_ficheiro & "_0" & Ext1
                If (System.IO.File.Exists(pasta_ficheiro)) Then
                    Dim i As Integer = 1
                    While (System.IO.File.Exists(pasta_ficheiro))
                        nome_temp = nome_ficheiro & "_0" & i.ToString & "-" & nome_Original & Ext1
                        pasta_ficheiro = pasta & nome_temp
                        i = i + 1
                    End While
  
                    Try
                        pasta_ficheiro = pasta_ficheiro
                        'Labelerro.Text = pasta_ficheiro
                        f.SaveAs(pasta_ficheiro)
                        ListBox1.Items.Add(nome_temp)
                        'Labelerro.Text = pasta_ficheiro
                    Catch ex As Exception
                        'Labelerro.Text = ex.Message
                    End Try
                Else
  
                    Try
                        pasta_ficheiro = pasta & nome_ficheiro & "_0-" & nome_Original & Ext1
                        'Labelerro.Text = pasta_ficheiro
                        f.SaveAs(pasta_ficheiro)
                        ListBox1.Items.Add(nome_ficheiro & "_0-" & nome_Original & Ext1)
                        ' Labelerro.Text = pasta_ficheiro
                    Catch ex As Exception
                        'Labelerro.Text = ex.Message
                    End Try
                End If
            Else
                Dim Ext1 As String = System.IO.Path.GetExtension(f.FileName)
                'Labelerro.Text = "O tipo de ficheiro (" & Ext1 & ") transferido não é permitido"
            End If
        Next
    End Sub
    Private Function Ve_Tipo_Ficheiro(ByVal pasta As String, ByVal Ficheiro As UploadedFile) As Boolean
  
        Dim pastaficheiro As String = pasta & Ficheiro.FileName
        Dim nomeficheiro As String = Ficheiro.FileName
        Dim MIMEType As String = Ficheiro.ContentType
        Dim tamanho As Integer = Ficheiro.ContentLength
        tamanho = CInt(tamanho / 1024)
        If TipoFicheiro(MIMEType.ToString()) Then
            Return True
        Else
            Return False
  
        End If
  
    End Function
    Private Function TipoFicheiro(ByVal Tipo As String) As Boolean
        Select Case Tipo
            Case "application/pdf"
                Return True
            Case Else
  
                Return False
        End Select
  
    End Function
  
  
    Protected Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        Dim file As String = ListBox1.SelectedItem.ToString
        System.Diagnostics.Process.Start(Server.MapPath(pasta_pdf) & "\" & file.ToString)
        ListBox1.SelectedIndex = -1
    End Sub
  
    Protected Sub RadTabStrip1_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles RadTabStrip1.TabClick
  
    End Sub
    Private Function Valido_Dados_Processos(ByVal tipo As Integer) As Boolean
        If rcb_sinistrado.Text.ToString.Trim = "" Then
            valido_dados_processo = False
            erro_nome_sinistrado.Visible = True
        Else
            erro_nome_sinistrado.Visible = False
        End If
  
  
        If rmtb_apolice.Text.ToString <> "" And cb_ns_apolice.Checked = False Then
            Dim apolice As String = rmtb_apolice.Text.ToString.Replace(" ", "a")
            If IsNumeric(apolice) Then
                erro_apolice.Visible = False
            End If
        ElseIf rmtb_apolice.Text.ToString = "" And cb_ns_apolice.Checked = True Then
            erro_apolice.Visible = False
        Else
            valido_dados_processo = False
            erro_apolice.Visible = True
        End If
  
        If rdtp_datasinistro.IsEmpty Then
            valido_dados_processo = False
            erro_data_sinistro.Visible = True
        Else
            erro_data_sinistro.Visible = False
        End If
  
  
        If rmtb_procesocompanhia.Text.ToString <> "" And cb_ns_proceso.Checked = False Then
            Dim proceso As String = rmtb_procesocompanhia.Text.ToString.Replace(" ", "a")
            If IsNumeric(proceso) Then
                erro_processo_companhia.Visible = False
            End If
        ElseIf rmtb_procesocompanhia.Text.ToString = "" And cb_ns_proceso.Checked = True Then
            erro_processo_companhia.Visible = False
        Else
            valido_dados_processo = False
            erro_processo_companhia.Visible = True
        End If
  
        Dim v1 As Boolean = False
        Dim v2 As Boolean = False
        If rb_condicional.Checked = False And rb_definitivo.Checked = False Then
            valido_dados_processo = False
            erro_recaida.ToolTip = erro_est
            v1 = True
        Else
            v1 = False
        End If
  
        If cb_recaida.Checked = True And tipo = novo_proceso Then
            valido_dados_processo = False
            If erro_recaida.ToolTip.ToString = "" Then
                erro_recaida.ToolTip = erro_rec
            Else
                erro_recaida.ToolTip = erro_recaida.ToolTip.ToString & break_line & erro_rec
            End If
            v2 = True
        Else
            v2 = False
        End If
  
        If v1 = True Or v2 = True Then
            erro_recaida.Visible = True
        Else
            erro_recaida.Visible = False
        End If
  
        If rcb_medico.Text = "" Then
            valido_dados_processo = False
            erro_medico.Visible = True
        Else
            erro_medico.Visible = True
        End If
  
        If rcb_gestor.IsEmpty Then
            valido_dados_processo = False
            erro_gestor.Visible = True
        Else
            erro_gestor.Visible = False
        End If
  
        If cb_ns_apolice.Checked = True And cb_ns_proceso.Checked = True Then
            valido_dados_processo = False
        End If
        Return valido_dados_processo
    End Function
    Private Function Valido_Dados_Sinistrados() As Boolean
        If Sinistrado_rtb_nome.Text = "" Then
            valido_dados_sinistrado = False
            Sinistrado_erro_nome.Visible = True
        Else
            Sinistrado_erro_nome.Visible = False
        End If
  
        If Sinistrado_rcb_nacionalidade.Text = "" Then
            valido_dados_sinistrado = False
            Sinistrado_erro_nacionalidade.Visible = True
        Else
            Sinistrado_erro_nacionalidade.Visible = False
        End If
  
        If Sinistrado_rb_m.Checked = False And Sinistrado_rb_f.Checked = False Then
            valido_dados_sinistrado = False
            Sinistrado_erro_sexo.Visible = True
        Else
            Sinistrado_erro_sexo.Visible = False
        End If
  
        If Sinistrado_rdp_dtnascimento.IsEmpty Then
            valido_dados_sinistrado = False
            Sinistrado_erro_datanascimento.Visible = True
        Else
            Sinistrado_erro_datanascimento.Visible = False
        End If
  
        If Sinistrado_rmb_ncontribuinte.Text = "" Then
            valido_dados_sinistrado = False
            Sinistrado_erro_ncontribuinte.Visible = True
        Else
            Sinistrado_erro_ncontribuinte.Visible = False
        End If
  
        Return valido_dados_sinistrado
    End Function
    Protected Sub cb_ns_proceso_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cb_ns_proceso.CheckedChanged
        If cb_ns_proceso.Checked = False Then
            rmtb_procesocompanhia.Text = ""
            rmtb_procesocompanhia.Enabled = False
        Else
            rmtb_procesocompanhia.Enabled = True
        End If
    End Sub
  
    Protected Sub cb_ns_apolice_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cb_ns_apolice.CheckedChanged
        If cb_ns_apolice.Checked = True Then
            rmtb_apolice.Text = ""
            rmtb_apolice.Enabled = False
        Else
            rmtb_apolice.Enabled = True
        End If
    End Sub
  
    Protected Sub rb_novo_proceso_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rb_novo_proceso.Click
        If Valido_Dados_Processos(novo_proceso) = True Then
        Else
            rtt_info_on_error.Visible = True
            rtt_info_on_error.Show()
        End If
    End Sub
  
    Protected Sub img_search_sinistrado_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles img_search_sinistrado.Click
        If rcb_sinistrado.Text <> "" Then
            processos.SelectCommand = selectCommand_proceso_grid & " WHERE Boletins.Sinistrado_ID = " & rcb_sinistrado.SelectedValue
            GridView1.DataSourceID = processos.ID
            GridView1.DataBind()
            'rg_processos.DataBind()
            erro_nome_sinistrado.ToolTip = erro_sin_nome
            erro_nome_sinistrado.Visible = False
        Else
            erro_nome_sinistrado.ToolTip = "Tem de introduzir um nome"
            erro_nome_sinistrado.Visible = True
        End If
    End Sub
  
    Protected Sub b_sinistrado_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles b_sinistrado.Click
        novoSinistrado.Show()
        sinis.Enabled = True
        novoSinistrado.Title = "Novo Sinistrado"
    End Sub
  
    Protected Sub img_search_proceso_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles img_search_proceso.Click
        If IsNumeric(rtb_processo.Text.ToString) Then
            erro_proceso_interno.Visible = False
            processos.SelectCommand = selectCommand_proceso_grid & " WHERE Boletins.Boletim_id = " & rtb_processo.Text.ToString
            'rg_processos.DataBind()
            GridView1.DataSourceID = processos.ID
            GridView1.DataBind()
        Else
            erro_proceso_interno.Visible = True
        End If
    End Sub
    Protected Sub Button1_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        novoSinistrado.Show()
        sinis.Enabled = False
        novoSinistrado.Title = "Dados de " + rcb_sinistrado.Text.ToString
        Dim strligacao As String = ConfigurationManager.ConnectionStrings("tester2").ConnectionString
        Dim ligacao As SqlConnection = New SqlConnection(strligacao)
        Dim SqlComm As String = "SELECT Sinistrados.Morada, Sinistrados.Localidade, Sinistrados.Codigo_Postal, Sinistrados.Telefone, Sinistrados.Sexo, Sinistrados.Dt_Nascimento, "
        SqlComm = SqlComm & " Sinistrados.N_Contribuinte, Sinistrados.Quando, Nacionalidades.Nacionalidade, Users.Nome"
        SqlComm = SqlComm & " FROM Sinistrados LEFT OUTER JOIN"
        SqlComm = SqlComm & " Nacionalidades ON Sinistrados.Nacionalidade = Nacionalidades.Natural_id LEFT OUTER JOIN"
        SqlComm = SqlComm & " Users ON Sinistrados.Quem = Users.Users_ID"
        SqlComm = SqlComm & " WHERE SINISTRADO_ID = " & rcb_sinistrado.SelectedValue.ToString
        Dim comand1 As New SqlCommand(SqlComm, ligacao)
        ligacao.Open()
        Try
            Dim dr1 As SqlDataReader
            dr1 = comand1.ExecuteReader
            While dr1.Read
                Sinistrado_rtb_morada.Text = dr1.GetValue(0).ToString
                Sinistrado_rtb_localidade.Text = dr1.GetValue(1).ToString
                Sinistrado_rmb_codigo.Text = dr1.GetValue(2).ToString
                Sinistrado_rmb_telefone.Text = dr1.GetValue(3).ToString
                If dr1.GetValue(4).ToString = "True" Then
                    Sinistrado_rb_m.Checked = True
                Else
                    Sinistrado_rb_f.Checked = True
                End If
                Dim bu As String = dr1.GetDateTime(5).Day & "-" & dr1.GetDateTime(5).Month & "-" & dr1.GetDateTime(5).Year
                Sinistrado_rdp_dtnascimento.SelectedDate = System.DateTime.Parse(bu)
                Sinistrado_rmb_ncontribuinte.Text = dr1.GetValue(6).ToString
                Sinistrado_lb_quando.Text = dr1.GetValue(7).ToString
                Sinistrado_rcb_nacionalidade.Text = dr1.GetValue(8).ToString
                Sinistrado_lb_quem.Text = dr1.GetValue(9).ToString
            End While
            dr1.Close()
            ligacao.Close()
        Catch ex As Exception
  
        End Try
    End Sub
  
    Protected Sub img_search_segurado_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles img_search_segurado.Click
        If rcb_tomador.SelectedItem.Text <> "" Then
            processos.SelectCommand = selectCommand_proceso_grid & " WHERE Boletins.Tomador_ID = " & rcb_tomador.SelectedValue
            'rg_processos.DataBind()
            GridView1.DataSourceID = processos.ID
            GridView1.DataBind()
            erro_tomador.Visible = False
        Else
            erro_nome_sinistrado.Visible = True
        End If
    End Sub
  
    Protected Sub img_search_apolice_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles img_search_apolice.Click
        If rmtb_apolice.Text <> "" Then
            processos.SelectCommand = selectCommand_proceso_grid & " WHERE Boletins.Apolice = " & rmtb_apolice.Text
            GridView1.DataSourceID = processos.ID
            GridView1.DataBind()
            'rg_processos.DataBind()
            erro_apolice.Visible = False
        Else
            erro_apolice.Visible = True
        End If
    End Sub
  
    'Protected Sub rg_processos_SelectedIndexChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rg_processos.SelectedIndexChanged
    '    Dim strligacao As String = ConfigurationManager.ConnectionStrings("tester2").ConnectionString
    '    Dim ligacao As SqlConnection = New SqlConnection(strligacao)
    '    Dim SqlComm As String = selectCommand_proceso_dados & " WHERE Boletins.Boletim_id = " & rg_processos.SelectedValue.ToString
    '    Dim comand1 As New SqlCommand(SqlComm, ligacao)
    '    ligacao.Open()
    '    Try
    '        Dim dr1 As SqlDataReader
    '        dr1 = comand1.ExecuteReader
    '        While dr1.Read
    '            Sinistrado_rtb_morada.Text = dr1.GetValue(0).ToString
    '            Sinistrado_rtb_localidade.Text = dr1.GetValue(1).ToString
    '            Sinistrado_rmb_codigo.Text = dr1.GetValue(2).ToString
    '            Sinistrado_rmb_telefone.Text = dr1.GetValue(3).ToString
    '            If dr1.GetValue(4).ToString = "True" Then
    '                Sinistrado_rb_m.Checked = True
    '            Else
    '                Sinistrado_rb_f.Checked = True
    '            End If
    '            Dim bu As String = dr1.GetDateTime(5).Day & "-" & dr1.GetDateTime(5).Month & "-" & dr1.GetDateTime(5).Year
    '            Sinistrado_rdp_dtnascimento.SelectedDate = System.DateTime.Parse(bu)
    '            Sinistrado_rmb_ncontribuinte.Text = dr1.GetValue(6).ToString
    '            Sinistrado_lb_quando.Text = dr1.GetValue(7).ToString
    '            Sinistrado_rcb_nacionalidade.Text = dr1.GetValue(8).ToString
    '            Sinistrado_lb_quem.Text = dr1.GetValue(9).ToString
    '        End While
    '        dr1.Close()
    '        ligacao.Close()
    '    Catch ex As Exception
  
    '    End Try
    'End Sub
  
    Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
        Dim row As GridViewRow = GridView1.Rows(GridView1.SelectedIndex)
        Dim boletim_id As Integer = row.Cells(1).Text
        Dim strligacao As String = ConfigurationManager.ConnectionStrings("tester2").ConnectionString
        Dim ligacao As SqlConnection = New SqlConnection(strligacao)
        Dim SqlComm As String = selectCommand_proceso_dados & " WHERE Boletins.Boletim_id = " & boletim_id
        Dim comand1 As New SqlCommand(SqlComm, ligacao)
        ligacao.Open()
        Try
            Dim dr1 As SqlDataReader
            dr1 = comand1.ExecuteReader
            While dr1.Read
                rtb_processo.Text = boletim_id
                rcb_sinistrado.SelectedItem.Text = rcb_sinistrado.FindItemByValue(dr1.GetValue(0)).Text
                rcb_tomador.SelectedItem.Text = rcb_tomador.FindItemByValue(dr1.GetValue(1)).Text
            End While
            dr1.Close()
            ligacao.Close()
        Catch ex As Exception
        End Try
    End Sub
End Class


Thanks,
FEST

2 Answers, 1 is accepted

Sort by
0
Accepted
Slav
Telerik team
answered on 06 Jul 2011, 04:21 PM
Hi Fest,

After tweaking a bit the code you provided in order to make it runnable, I succeeded in reproducing the problem. It is caused by using HTML markup comment tags, that are not suitable for this case (<!-- -->).
The correct way to comment ASP page is with ASP markup comment tags:
<%-- your markup here  --%>

This is a server-side comment and will not be delivered to the client.

You can see the suggested solution in action in the short video below:
http://screencast.com/t/X9AT5vjem

If the solution provided above does not help you resolve your issue please open a support ticket and send us a sample, runnable project that isolates your case so that we can inspect it and determine the cause for the problem.

Greetings,
Slav
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
FEST
Top achievements
Rank 1
answered on 07 Jul 2011, 09:27 AM
HI Slav!

Thanks for the information, i never would think of such thing. It did stop the problem at least from appearing still when i debbug mycode i can se in the bar for a brief moment " error compiling". I don't know what it is but i'm tryng to understand it. I'm sorry for taking your time with matters that seemed not to have anything to do with telerik objects. Im not closing this thread just for now cause i might find what that problem is but if not i will close it. Againg, many thanks and sorry for the inconvinience.

Grats,

FEST
Tags
General Discussions
Asked by
FEST
Top achievements
Rank 1
Answers by
Slav
Telerik team
FEST
Top achievements
Rank 1
Share this question
or