ig25192 Posted February 19, 2009 at 05:40 PM Report Share #245577 Posted February 19, 2009 at 05:40 PM Olá, Tenho um website em VB.Net que utiliza um DataList que é carregado com imagens. Tenho também uma combox com o nº de items a listar (4,8,12,16 ou tudo). No IE tudo funciona perfeitamente, quando utilizo o Firefox dá-me um erro estranho quando mudo o nº de items para 12 ou 16!!!! Foi gerada uma excepção não processada durante a execução do pedido Web actual. As informações relativas à origem e localização da excepção poderão ser identificadas através da utilização do rastreio da pilha de excepções abaixo. [FormatException: Cadeia de caracteres de entrada com formato incorrecto.] System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2755599 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +112 System.Int32.Parse(String s, IFormatProvider provider) +22 System.Web.UI.WebControls.ImageButton.LoadPostData(String postDataKey, NameValueCollection postCollection) +192 System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +36 System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +898 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2533 Já pesquisei no Google por este tipo de erro mas sem grande sucesso. Qualquer ajuda é bem vinda 😛 Gracias Link to comment Share on other sites More sharing options...
Hellblazer Posted February 19, 2009 at 05:47 PM Report Share #245578 Posted February 19, 2009 at 05:47 PM Secção errada lol Mas mostra a o codigo 😛 There are two ways to write error-free programs; only the third one works. Link to comment Share on other sites More sharing options...
ig25192 Posted February 19, 2009 at 06:24 PM Author Report Share #245588 Posted February 19, 2009 at 06:24 PM Combobox com o nº da página <radc:radcombobox id="cboPag" runat="server" autopostback="True" skin="WebBlue" skinspath="~/RadControls/ComboBox/Skins" width="54px" /> Botão para navegar para página anterior <asp:ImageButton ID="imgPagAnt" runat="server" ImageUrl="~/Img/arrow-back_16.png" /> Botão para navegar para página seguinte <asp:ImageButton ID="imgPagProx" runat="server" ImageUrl="~/Img/arrow-forward_16.png" /> Combox com nº de items por página <asp:Label ID="lblItensPorPag" runat="server" CssClass="txt_la_10" Text="Itens/pág." /> O Code Behind tem um conjunto de funções... Função que Vai para a página anterior Protected Sub imgPagAnt_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgPagAnt.Click Dim pag As Integer pag = CInt(Me.cboPag.Text.ToString) - 1 Me.PreencherModelos(Me.lblCatalogoActivo.Text, "", "", Me.lblCategActiva.Text, Me.lblMarcaActiva.Text, _ Me.cboItensPag.Text, pag) End Sub Função que Vai para a página seguinte Protected Sub imgPagProx_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgPagProx.Click Dim pag As Integer pag = CInt(Me.cboPag.Text.ToString) + 1 Me.PreencherModelos(Me.lblCatalogoActivo.Text, "", "", Me.lblCategActiva.Text, Me.lblMarcaActiva.Text, _ Me.cboItensPag.Text, pag) End Sub Função que preenche o DataList Private Sub PreencherModelos(ByVal pCat As String, ByVal pModelo As String, ByVal pRefCli As String, ByVal pLinha As String, ByVal pMarca As String, _ ByVal pQtPag As Integer, ByVal pPag As Integer) ...... totalMod = cmMod.Parameters("@TotalModelos").Value 'dsMod.Tables.Add(dtMod) If totalMod = 0 Then Me.DataList1.Visible = False Else Me.DataList1.Visible = True Me.DataList1.DataSource = dtMod Me.DataList1.DataBind() End If If pQtPag = 0 Then totalPag = 1 Else totalPag = CInt(totalMod \ pQtPag) If (totalMod Mod pQtPag) > 0 Then totalPag += 1 End If End If End Sub TUDO ISTO FUNCIONA NO IE...NO FIREFOX DÁ O ERRO ACIMA MENCIONADO Link to comment Share on other sites More sharing options...
Hellblazer Posted February 20, 2009 at 08:53 AM Report Share #245712 Posted February 20, 2009 at 08:53 AM nao entendo o que faz estas duas linhas: pag = CInt(Me.cboPag.Text.ToString) + 1 pag = CInt(Me.cboPag.Text.ToString) - 1 supostamente o cboPag nao e a combo com o numero de registos por pagina? entao que relação tem com a pag actual? Mas passando a frente... faz debug na aplicação deves estar a tentar manipular uma string que está a null 😕 There are two ways to write error-free programs; only the third one works. Link to comment Share on other sites More sharing options...
ig25192 Posted February 20, 2009 at 10:51 AM Author Report Share #245732 Posted February 20, 2009 at 10:51 AM cboPag contem o nº da página actual. As funções que navegam para a página seguinte e anterior adicionam ou subtraem 1 página ao nº da página actual e envia a nova página para a função que carrega o DataList. Tudo isto no IE funciona muito bem, no Firefox dá o erro mencionado. Ex. Tenho um catálogo com 30 items, se ponho a mostrar 4 items por página consigo navegar nas páginas sem problema, quando altero para 8 items por página ou mais, dá-me o erro. Mesmo muito esquisito Link to comment Share on other sites More sharing options...
Hellblazer Posted February 20, 2009 at 11:39 AM Report Share #245742 Posted February 20, 2009 at 11:39 AM Estas a utilizaralg um Third Party Control? There are two ways to write error-free programs; only the third one works. Link to comment Share on other sites More sharing options...
ig25192 Posted February 20, 2009 at 02:46 PM Author Report Share #245781 Posted February 20, 2009 at 02:46 PM Sim, utilizo uns controlos da Telerik, mas já testei com os asp:Dropdownlist e asp:textbox com valores e mesmo assim dá erro! Mas não seria normal dar o erro também no firefox!? Link to comment Share on other sites More sharing options...
Hellblazer Posted February 20, 2009 at 03:31 PM Report Share #245791 Posted February 20, 2009 at 03:31 PM Nao... e normal entao estar a dar erro 😕 A telerik teve aqui a tempo uns problemas iguaizinho que foram corrigidos com os Q1 2008 se nao estou em erro 🙂 Edit: Estive a investigar e axo qe foi com o RadAjax. There are two ways to write error-free programs; only the third one works. Link to comment Share on other sites More sharing options...
ig25192 Posted February 20, 2009 at 05:01 PM Author Report Share #245807 Posted February 20, 2009 at 05:01 PM Bem visto 😕 Tirei o RadAjax e funciona... Onde posso sacar essa correcção. Estou a pegar num projecto feito por outro colega que utiliza estes controlos e ainda não estudei isto ao pormenor ? Link to comment Share on other sites More sharing options...
Hellblazer Posted February 20, 2009 at 05:19 PM Report Share #245813 Posted February 20, 2009 at 05:19 PM www.telerik.com 😕 mas e cara a licença lol 🙂 There are two ways to write error-free programs; only the third one works. Link to comment Share on other sites More sharing options...
ig25192 Posted February 20, 2009 at 05:26 PM Author Report Share #245816 Posted February 20, 2009 at 05:26 PM eu utilizo o Q3 2006... então so pondo o Q1 2008 é que funciona né!? Bem...fica assim 😕 sem RadAjax Obrigadão pela ajuda...ia demorar a chegar lá 😁 Link to comment Share on other sites More sharing options...
Hellblazer Posted February 20, 2009 at 05:29 PM Report Share #245820 Posted February 20, 2009 at 05:29 PM No problemo 😕 Mete e no nome do topico resolvido para ajudar na organizaçao do forum 🙂 There are two ways to write error-free programs; only the third one works. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now