Jump to content
Xtreme .Net Talk

Bodybag

Avatar/Signature
  • Posts

    75
  • Joined

  • Last visited

Everything posted by Bodybag

  1. This works. <HTML> <input type='textbox' id='txtimage'> <input type='button' onclick='document.getElementById("im").src = document.getElementById("txtimage").value' > <img id=im src='d.gif'> </HTML>
  2. You should be able to do this in javascript.I think.Just give them a textbox where they type in the path and change the src of a img tag.
  3. I sent a mail but it said it could not be delivered.Here it is again. Me.adapscheduler.Fill(dattable) ->> This is the adapter that you have to create your self. Try this Dim myCommand As New Odbc.OdbcDataAdapter("select * from item", MyConnection) Dim ds As New DataSet myCommand.Fill(ds, "item") Excellexport.Export.exportToExcellAsp(ds.Tables("item")., Me.Response)
  4. Simplified version just pass it a datagrid that has been populated and your response object and it should work.You don't need to display datagrid. If you have more problems i will mail you a dll that will do it for you. datagridtoExcell (datagrid,response) Public Shared Sub DataGridToExcel(ByVal dgExport As DataGrid, ByVal response As HttpResponse) 'clean up the response.object response.Clear() response.Charset = "" 'set the response mime type for excel response.ContentType = "application/vnd.ms-excel" 'create a string writer Dim stringWrite As New System.IO.StringWriter 'create an htmltextwriter which uses the stringwriter Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite) 'instantiate a datagrid Dim dg As New DataGrid ' just set the input datagrid = to the new dg grid dg = dgExport ' I want to make sure there are no annoying gridlines dg.GridLines = GridLines.None ' Make the header text bold dg.HeaderStyle.Font.Bold = True ' If needed, here's how to change colors/formatting at the component level 'dg.HeaderStyle.ForeColor = System.Drawing.Color.Black 'dg.ItemStyle.BackColor = System.Drawing.Color.White 'dg.BorderColor = System.Drawing.Color.White 'bind the modified datagrid dg.DataBind() 'tell the datagrid to render itself to our htmltextwriter dg.RenderControl(htmlWrite) 'output the html response.Write(stringWrite.ToString) response.End() End Sub
  5. Can you show me the code that you fill your radiobuttons with and the code that you check it with.
  6. I think i might know what is wrong .Do you fill your radiobuttons before you check it.What i mean is you could be refreshing the radio buttons before you validate them. use a if not me.ispostback radiobutton fill code. end if
  7. I don't know if this will help.I wrote a test centre and what i did was loop through each item in the option the radio button checking them all. For count = 0 To optans.Items.Count - 1 dtanswers.Tables("answers").Rows(Session("curpos")).Item(count) = optans.Items(count).Selected.ToString Next
  8. How do i save the viewstate of controls dynamiclly created on a webcontrol.
  9. I will try that. THanks.
  10. The following is what i did.Basicly the same so there is no other way. Protected myWEBcontrol1 As WebUserControl1 Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. myWEBcontrol1 = CType(Me.FindControl("MYWEBCONTROL1"), WebUserControl1) InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here Me.myWEBcontrol1.Button1.Text = "DD" End Sub
  11. This may sound rather stupid but i must be missing something.When i create a web control and drag onto a web form.How do i access it from my form code. It does not create instance of the control.I have used the findcontrol method .But it seems like a long way around .Is there no other way. What i want to do is use it like any normal web control ex dropdownlist.
  12. Never been to Lesotho.I have been to Swaziland.Quiet little country not bad. One African country i would go work in is Botswana. No crime and good economy.
  13. Actualy i want to apoligize about my south african comment. Been a rough 2 months we have had armed robbery down stairs from where i work , a bom threat across the road, Someone robbed my friend with a knife and tried to stab him. They robbed another friend blind, broke into five houses in our neigbourrhood, and broke into my car and stole my radio.Been a bad couple of months.
  14. As long as you don't sleep in central Johannesburg in your car.:)
  15. I am a little lost myself.
  16. Africa is very unstable at the moment.South africa is heading the same way as zimbabwe.I know i live in south africa.So you beter travel quickly.
  17. dim s1 as string = "jack" dim s2 as string = "Daniels" label1.text = "i drink " & s1 & " " & s2 & "<br>"
  18. Sorry that was for a windows app , try this for asp Public Shared Sub exportToExcell(ByVal Dattable As DataTable) Dim a As New Web.UI.WebControls.DataGrid a.DataSource = Dattable a.DataBind() DataGridToExcel(a) End Sub Public Shared Sub DataGridToExcel(ByVal dgExport As DataGrid, ByVal response As HttpResponse) 'clean up the response.object response.Clear() response.Charset = "" 'set the response mime type for excel response.ContentType = "application/vnd.ms-excel" 'create a string writer Dim stringWrite As New System.IO.StringWriter 'create an htmltextwriter which uses the stringwriter Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite) 'instantiate a datagrid Dim dg As New DataGrid ' just set the input datagrid = to the new dg grid dg = dgExport ' I want to make sure there are no annoying gridlines dg.GridLines = GridLines.None ' Make the header text bold dg.HeaderStyle.Font.Bold = True ' If needed, here's how to change colors/formatting at the component level 'dg.HeaderStyle.ForeColor = System.Drawing.Color.Black 'dg.ItemStyle.BackColor = System.Drawing.Color.White 'dg.BorderColor = System.Drawing.Color.White 'bind the modified datagrid dg.DataBind() 'tell the datagrid to render itself to our htmltextwriter dg.RenderControl(htmlWrite) 'output the html response.Write(stringWrite.ToString) response.End() End Sub
  19. Example of use. export.exportToExcell(Datatable,"C:\test.xls") //CODE Public Class Export Private Shared Sub DataGridToExcel(ByVal dgExport As Web.UI.WebControls.DataGrid, ByVal spath As String) 'clean up the response.object Try 'create a string writer Dim stringWrite As New System.IO.StringWriter 'create an htmltextwriter which uses the stringwriter Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite) Dim dg As New Web.UI.WebControls.DataGrid dg = dgExport dg.DataBind() 'tell the datagrid to render itself to our htmltextwriter dg.RenderControl(htmlWrite) 'output the html Dim w As New IO.StreamWriter(spath, False) w.Write(stringWrite.ToString) w.Close() Catch err As Exception MsgBox(err.Message) End Try End Sub Public Shared Sub exportToExcell(ByVal Dattable As DataTable, ByVal spath As String) Dim a As New Web.UI.WebControls.DataGrid a.DataSource = Dattable a.DataBind() DataGridToExcel(a, spath) End Sub End Class
  20. dim s as string= "John" response.write (s)
  21. What does your table structure look do you allow nulls into thiese fields.If not it won't allow the updates.
  22. I tried doing it. It Disables textboxes and labels. However dropdownlists can still be accesed and buttons can be clicked even if they are grayed out.
  23. <asp:CheckBox id=chkpresent runat="server" Width="10px" Checked='<%# DataBinder.Eval(Container, "DataItem.SchedulerAtwork") %>'></asp:CheckBox> Private Sub saveall(ByVal dt As DataList, ByRef tbl As DataTable) For irowcount As Integer = 0 To dt.Items.Count - 1 tbl.Rows.Find(CType(dt.Items(irowcount).FindControl("lblpk"), Label).Text).Item("scheduleratwork") = CType(dt.Items(irowcount).FindControl("chkpresent"), CheckBox).Checked Next Me.adapscheduler.Update(tbl) End Sub Hope this what you wanted to do.
  24. Very simply. Take out the position Absolute in the style property of the datagrid and do this as well for the buttons.You will then have to use the appriate breaks and spaces to put them in correct positions. Another way would be to put them in a html table. eg <TABLE> <TR> <TD><datagrid> </datagrid></TD> </TR> <TR> <TD><asp:button> </Asp:button></TD> </TR> </TABLE>
  25. I have the following problem.When i disable my datalist eg datalist.enabled = false. Controls in the item template does not disable for example the dropdownlist. Buttons still post back to the server even if they are grayed out.Is there a way to fix this.What i have done is loop through each control in the datalist disabeling it but it takes a long time.
×
×
  • Create New...