|
Well, In which area you are facing problem ? Loading data to the drop down ? Or getting data and binding the grid when drop down changes ? Have you made autopostback=true ? Sending sample code will be easy to understand the problem
|
|
|
|
|
I have managed to load data onto the dropdown, but binding the datagrid when something is selected from the dropdown.
Here is some code from a working vb.net page.
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
con = New OleDbConnection("Provider = Microsoft.Jet.oledb.4.0; data source = C:\TelephoneList.mdb")
con.Open()
'Dim str As String = "Select Branch,[Contact Name], [Telephone Number], [Telephone Extension], [Fax Number], [Fax Extension] from [Other Branches] Where Branch = '" & DropDownList1.SelectedValue & "'"
' Dim con As New OleDbConnection
Dim comx As New OleDbCommand
comx = New OleDbCommand("Select [Contact Name],[Telephone Number], [Telephone Extension], [Fax Number], [Fax Extension] from [Other Branches] where Branch = '" & DropDownList1.SelectedValue & "'", con)
comx.Connection = con
If con.State = ConnectionState.Open Then
con.Close()
End If
con.Open()
'Dim cm As New OleDbCommand(str, con)
GridView1.DataSource = comx.ExecuteReader(CommandBehavior.CloseConnection)
GridView1.DataBind()
If con.State = ConnectionState.Open Then
con.Close()
End If
' ***********Now Im allocating data to the second datagrid
Dim comxx As New OleDbCommand
comxx = New OleDbCommand("Select [Alternative Contact], [Second Alternative], [Alt Telephone], [Alternative Ext] from [Other Branches] Where [Branch] = '" & DropDownList1.SelectedValue & "'", con)
'Dim str2 As String = "Select Branch, [Alternative Contact], [Second Alternative], [Alternative TelNumber], [Alternative TelExtension], [Cell] Where [Branch] = '" & DropDownList1.SelectedValue & "'"
comxx.Connection = con
If con.State = ConnectionState.Closed Then
con.Open()
End If
'con.Open()
'Dim command As New OleDbCommand(str2, con)
GridView2.DataSource = comxx.ExecuteReader(CommandBehavior.CloseConnection)
GridView2.DataBind()
con.Close()
If DropDownList1.SelectedValue = "UNITRANS" Then
lblMessage.Text = "Here Are Other Users For " & DropDownList1.SelectedValue
Dim Comxxx As New OleDbCommand
Comxxx = New OleDbCommand("Select User, Telephone, Notes from [Other Users] where Branch = '" & DropDownList1.SelectedValue & "'", con)
If con.State = ConnectionState.Closed Then
con.Open()
End If
GridView3.DataSource = Comxxx.ExecuteReader(CommandBehavior.CloseConnection)
GridView3.DataBind()
con.Close()
Else
If DropDownList1.SelectedValue = "A.HAK Industrial Services" Then
lblMessage.Text = "Here Are Other Users For " & DropDownList1.SelectedValue
Dim Comxxx As New OleDbCommand
Comxxx = New OleDbCommand("Select User, Telephone, Notes from [Other Users] where Branch = '" & DropDownList1.SelectedValue & "'", con)
If con.State = ConnectionState.Closed Then
con.Open()
End If
GridView3.DataSource = Comxxx.ExecuteReader(CommandBehavior.CloseConnection)
GridView3.DataBind()
con.Close()
End If
End If
End Sub
kagiso
|
|
|
|
|
What error you are getting here ? Are you getting values to all datareader ?
|
|
|
|
|
I don get any values out.I think the connection is a problem aswell
kagiso
|
|
|
|
|
Print your query before executing. Copy the query and execute it directly on your DB and check it is returning value..
|
|
|
|
|
Im gona have to battle to do this tonite and if I still have a problem I will get back to you.
Thanx for your assistance
kagiso
|
|
|
|
|
|
Ok, I managed to come up with this, now can anyone tell me where I went wrong coz when I run the page, i don get any values into the DropDown.
<%@ Language=VBScript %>
<%Option explicit
Dim oRs, conn, connect, strSQL
set conn=server.CreateObject ("adodb.connection")
connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("C:\CFusionMX\wwwroot\Working Site\Home Pagecourses.mdb") & ";Persist Security Info=False"
conn.Open connect
%>
<title>Example combo box
The following was selected : <%=Request.Form ("courses")%>
<%
Set oRs=Server.CreateObject("adodb.recordset")
strSQL = "SELECT DISTINCT CourseName FROM tblCourses ORDER BY CourseName"
oRs.Open strSQL, conn
Do while not oRs.EOF
if Request.Form("courses") = oRs("CourseName") then 'if this is the selected one then display as selected
Response.Write ""
Response.Write oRs("CourseName") & ""
oRs.MoveNext
else
Response.Write ""
Response.Write oRs("CourseName") & ""
oRs.MoveNext
end if
loop
%>
kagiso
|
|
|
|
|
Hi Guys,
I don't know if what's lacking with my source code.
I have a problem about the ID declared within the <LoggedInTemplate></LoggedInTemplate>. And in my aspx.vb code behind the ID that was supposedly be used intead was produced an error - " Webchartviewer1 not declared"
Example Code Below: Error: "Webchartviewer1 not declared"
...
<LoggedInTemplate>
<asp:Panel ID="Panel2" runat="server" BackColor="white"
Width="99%" HorizontalAlign=left>
<asp:chart:WebChartViewer ID="WebChartViewer1" runat="server"/>
</asp:Panel
</LoggedInTemplate>
...
below is aspx.vb code behind
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
WebChartViewer1.Image = c.makeWebImage(Chart.PNG)
End Sub
hifiger2004
|
|
|
|
|
I am sending some mail by a console program using smtp server..
But in yahoo the mails r going to spam..while the same mail are going to inbox in gmail..
can anyone tell me the reason plzzzzzz.
hiiiiii
|
|
|
|
|
Are you using any authentication ?
|
|
|
|
|
ya I am using authentications...It is going to inboxbox folder of gmail but not in yahooo.????
hiiiiii
|
|
|
|
|
|
mozilla is not supporting my email validation function..
can anyone tell me the reason please???
function CheckEmail()
{
check=1;
var emailtext=document.getElementById('emailtext');
var email = emailtext.value;
var AtPos = email.indexOf("@");
var StopPos = email.lastIndexOf(".");
if ((email == "")||(AtPos == -1 || StopPos == -1)||(StopPos < AtPos)||(StopPos - AtPos == 1)||(AtPos == 0) )
{
Message = "Not a valid Email address" ;
check=0;
}
if(Message=="")
{
mailerror.style.display="none";
}
else if(Message !="")
{
mailerror.style.display="";
}
}
hiiiiii
|
|
|
|
|
In this code where you are referring mailerror. What element is that ? Try getting that element object by getElementById.
hkchauhan wrote: mailerror.style.display="";
What do you mean by this line ? Are you trying to display the element ? Then use display='block'. Put alert line by line, and check. Then you will come to know where the problem is
|
|
|
|
|
Open up the error console so that you see what error message you get.
---
single minded; short sighted; long gone;
|
|
|
|
|
Guffa wrote: Open up the error console so that you see what error message you get.
How we can get the mozilla error console ? I got IE but mozilla I didn't ?
|
|
|
|
|
I don't have the Mozilla suite installed at the moment, so I don't know exactly how you do it in that browser, but in Mozilla Firefox you open the error console from the Tools menu.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Hi all,
I need to use mssoapclient30 to reach a web service which use complex types as parameters and return types. There write in mssoap toolkit documantation use Type Mapper, but could not get understand how to write this file and how to call it in code.
Basiclly I call a service method
var Client = WScript.CreateObject("MSSOAP.SoapClient30"); <br />
Client.mssoapinit("http://abc.com/service.wsdl","","",""); <br />
<br />
var sid = Client.MethodName("abc..."); <br />
<br />
.<br />
.<br />
.
and I don't know what will be if the parameter description says
<complexType name="Alert">
<all>
<element name="tag" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="true" />
<element name="msg" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="true" />
</all>
</complexType>
as parameter to pass method and return type in wsdl.
karanba
|
|
|
|
|
Hi,
I've done a routine that generates an image using GDI+. The image shows a industrial process and the process changes every second.
I have coded a ordinary winapp that uses this routine to display the process. The winapp uses a timer to generate a new image evey second. I display the image in a picturebox and uses doublebuffering to avoid flickering.
Now I tries to do the same thing in a Web-app. I have a Updatepanel and inside that a timer and a image tag. This solutions work, but the picture flickers a lot. Espcially if it takes some time do load a new picture. How can i avoid this?
Is it possible to load the a new picture in the background and show it when loading has finnished?
Any suggestions and tips will be appreciated!
|
|
|
|
|
Yes, it is possible, a lot of sites would, for example, have hidden fields that load rollover images, so they are forced to load and are already there the first time they are needed.
The thing is, I'm not sure you can generate an event when your image loads.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Your problem is that the code in the update panel is loaded, and after that the image starts to load.
Instead you can preload the image using Javascript and then just change the src property of the image tag. That way the image is already loaded when you switch, and the html doesn't change so there is no re-rendering of the page.
Make a web page that generates the image and only returns the image data to the browser using Response.BinaryWrite. That way you integrate the call to the server and the loading of the image into one step, elliminating the need for AJAX to run the image generation on the server.
---
single minded; short sighted; long gone;
|
|
|
|
|
using System.Web.UI.WebControls;
Image thumbImage = new Image();
thumbImage.Attributes.Add("onclick", "window.location.href='" + @"\images\" + filePath + "';");
but the resulting page is giving following error:
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /thumbdb/imagesWaterlilies.jpg
-- modified at 4:58 Thursday 21st June, 2007
-<>-shoaib-<>-
|
|
|
|
|
how to pass the value from comboBox component to asp.net in flash
|
|
|
|