|
The whole point of a list of radio buttons is that only 1 item is selectable. If you use an asp:RadioButtonList it does all this for you.
Saying that, what exactly doesnt work in the code you've written?
|
|
|
|
|
thank u got the point... but i will try it..
Thanx,
KOUNDINYA
|
|
|
|
|
Hello,
I'm trying to display a picture from my db using linq.
protected void Button1_Click(object sender, EventArgs e)
{
DataClassesDataContext db = new DataClassesDataContext();
test1 x2 = db.test1s.First(p => p.descriere.StartsWith(" Firma bazata pe intuitia cumparatorulu"));
byte[] img = (x2.img);
MemoryStream ms = new MemoryStream(img);
System.Drawing.Image Image1 = System.Drawing.Image.FromStream(ms);
MemoryStream stream = new MemoryStream;
Image1.Save(stream,ImageFormat.Jpeg);
Bitmap b = new Bitmap(Image1.Width, Image1.Height);
Graphics g = new Graphics.FromImage(b);
}
where test1 is a table with 3 fields- id-int/descriere char/img image.
my error: 'System.Drawing.Graphics.FromImage(System.Drawing.Image)' is a 'method' but is used like a 'type'.
Can someone tell me what why or tell me how to do it? Please dont tell me to search on goole..
i have read everything i could find on google and i cant figure it out.. i'm new in the field.
|
|
|
|
|
Hi,
the compiler error is saying anything. First Graphics.FromImage is a static method so you should rewrite it like this:
Graphics g = Graphics.FromImage(b);
Second if you try to run a method on an object, created in the same line you have to write it like this:
object a = (new B()).callMethodA();
Regards
Sebastian
|
|
|
|
|
protected void Button1_Click(object sender, EventArgs e)
{
DataClassesDataContext db = new DataClassesDataContext();
test1 x2 = db.test1s.First(p => p.descriere.StartsWith(" Firma bazata pe intuitia cumparatorulu"));
byte[] img = (x2.img);
MemoryStream ms = new MemoryStream(img);
System.Drawing.Image Image1 = System.Drawing.Image.FromStream(ms);
MemoryStream stream = new MemoryStream();
Image1.Save(stream,ImageFormat.Jpeg);
Bitmap b = new Bitmap(Image1.Width, Image1.Height);
Graphics g = Graphics.FromImage(b);
g.DrawImage(Image1, 0, 0);
}
the code works but it doesn't display anything. When i debugged i saw that the image is loaded correctly in image1 and in b. Any ideas?
|
|
|
|
|
Do you have a control to display the image? ImageBox or Image?
|
|
|
|
|
Yes, the control is Image1 - type System.Web.UI.WebControls.Image
|
|
|
|
|
The problem is that it is not that simple. The Image Control needs an URL to point to the image to display. What you need to do is to build a page which takes the image-identifier as parameter (within the query string) and puts out as response the image content. The Image Control points to this page. Sounds complicated but is really easy. Found a tutorial in the web:
http://www.sitepoint.com/article/generating-asp-net-images-fly/[^]
Hope this helps.
|
|
|
|
|
Hi,
I want to use a Frameset in .net webpage. This Framset is to create a Left Navigation menu. In the Frameset i want to have a Tree view control. I dont have idea about the Frameset. Can anybody pls help me on how to use a Frameset in .Net with Tree view control.
Tnx in advance.
With Regards,
Anand
|
|
|
|
|
Do not use a frame set!
Try a master page. There are countless examples of how to do this all over the interweb.
I didn't get any requirements for the signature
|
|
|
|
|
|
I have created 5 RadioButtons dynamically on 5 place holders
They are created on the click on another button i.e. not on the PageLoad event
I have added a handler for each of them like:
rad1.CheckedChanged += new EventHandler(rad_CheckedChanged);<br />
rad2.CheckedChanged += new EventHandler(rad_CheckedChanged);<br />
...
Same event handler for all
The controls render fine, but when I check them all the control disappear and the checkedchanged event is not fired.
I read somewhere that they need to be created on the pageload event. But the need to be created on an event after the pageload.
plz hlp.
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
|
I have created on crosstab report in crystal report and applying the css to that report,and showing report in webapplication which is developed in .net (ASP and c#.net). I am trying to export that report, it export but css is lost.
can we export the report along with css? if yes How?
|
|
|
|
|
Good Afternoon All
I have a Code that write a WebConfig everytime it loads.
public void UpdateConfig(string strKey, string strValue)
{
Configuration objConfig = WebConfigurationManager.OpenWebConfiguration("~");
AppSettingsSection objAppsettings = (AppSettingsSection)objConfig.GetSection("appSettings");
if (objAppsettings != null)
{
objAppsettings.Settings[strKey].Value = strValue;
objConfig.Save();
}
}
Its working,on the Developement side, and i have deployed my app to the Testing side and when i go to the page i get the Following Error that i cant google, it seems it has something to do with the Permission. so i get the Following Error
Parser Error Message: An error occurred loading a configuration file: Access to the path 'C:\inetpub\wwwroot\o!Booking\1vc6a6ca.tmp' is denied.
[No relevant source lines]
Source File: C:\inetpub\wwwroot\o!Booking\web.config Line: 0
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
Good Afternoon
Thanks for your Help.
The Problem was the Permission for the ASP.NET Account that was never inherrited when i created a Virtual Directory. The Following thread helped me
http://bytes.com/groups/net-asp/634802-configuration-error-web-config-no-relevant-source-line
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
I am doing a project. Its 1 of the module is deigning of Forum same as the structure of Code project Forum. Can anyone suggest the database for it? Please...
|
|
|
|
|
Karthick_gc wrote: Can anyone suggest the database for it?
SQL Server?
|
|
|
|
|
Yes. I want the table structure for that?
|
|
|
|
|
Karthick_gc wrote: I want the table structure for that?
this depends exactly on your requirements ....
first think what functionality you want to have in your forum, then go on adding corresponding field to your database (or separate tables !)
Apurv
A man is but the product of his thoughts. What he thinks, he becomes.
.......Mahatma Gandhi
Be the change you want to see in the world.
.......Mahatma Gandhi
|
|
|
|
|
<pre>
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script runat="server">
Dim MyReader As SqlDataReader
Dim mySQLConnection As SqlConnection
Dim mySQLCommand As SqlCommand
Dim PID As Integer
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
If (TextBox1.Text <> "") Then
Panel1.Visible = True
Panel2.Visible = True
Else
Panel1.Visible = False
Panel2.Visible = False
End If
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
mySQLConnection = New SqlConnection("server=localhost;AttachDbFilename=C:\Documents and Settings\ANISHA\My Documents\Visual Studio 2005\ROHINI\WindowsApplication1\WindowsApplication1\Database.mdf;Integrated Security=True;User Instance=True")
mySQLCommand = New SqlCommand("SELECT * FROM PATIENT WHERE PID='111'", mySQLConnection)
Try
mySQLConnection.Open()
MyReader = mySQLCommand.ExecuteReader()
If (MyReader.Read()) Then
Panel1.DataBind()
End If
Catch ex As Exception
MsgBox(ex.ToString())
Finally
MyReader.Close()
mySQLConnection.Close()
End Try
End Sub
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<center>
<table>
<tr>
<td colspan="2">
<asp:Label ID="Label2" runat="server" Height="4px" Text="Patient Details" Width="139px" Font-Bold="True" Font-Size="Larger"></asp:Label></td>
</tr>
<tr>
<td style="width: 114px">
<asp:Label ID="Label1" runat="server" Text="Patient Id"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="TextBox1" runat="server" Height="15px" Width="66px"></asp:TextBox></td>
</tr>
<tr>
<td colspan="2">
<asp:Button ID="Button2" runat="server" Text="Display" OnClick="Button2_Click" /></td>
</tr>
<tr><td style="width: 114px"><asp:Panel ID="Panel1" Visible="false" runat="server" Height="176px" Width="185px" HorizontalAlign="Left" BorderColor="Cyan" >
Panel1<br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<tr><td>
<asp:Label ID="Label3" runat="server" Text="Report Incident" Width="117px"></asp:Label></td>
<tr><td><asp:DropDownList ID="drop1" runat="server" Height="6px" Width="54px">
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:DropDownList></td><br /><br /><br />
<center>
<asp:Button ID="Button1" runat="server" Text="Enter to Report" PostBackUrl="~/Rep Entry Screen.aspx" OnClick="Button1_Click" /> </center>
</asp:Panel>
</td>
<td style="width: 100px">
<asp:Panel ID="Panel2" Visible="false" runat="server" Height="176px" Width="185px" HorizontalAlign="Left" BorderColor="Cyan" >
<center>
Displayed Report Entry Scren</center><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center>
</center></asp:Panel>
</td>
</tr>
</table>
</center>
</asp:Content>
</pre>
Thanx,
KOUNDINYA
|
|
|
|
|
Hi i just give u a logic .
Bind Dataset ds or DataReader dr with Query ... select * from tablename where pid =@pid
for dataset use
if(ds.Teables[0].Rows.Count>0)
{
Panel1.DataBind()
}
else
{
"NOthing"
}
for datareader use
while(dr.read())
{
if(dr.HasRows())
{
Panel1.DataBind()
}
else
{
"NOthing"
}
}
Try This May Be This Help .
|
|
|
|
|
i think i did use the same logic... haven`t i??
Thanx,
KOUNDINYA
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
var change = false;
function showmsg(id) {
var res = confirm("proceed");
if (res)
change = true;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label runat="server" ID="lbl" />
<asp:TextBox ID="TextBox1" runat="server" onblur = "showmsg(this.id)" ></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button"
OnClientClick = "return change;change=false;" onclick="Button1_Click" />
</div>
</form>
</body>
</html>
.cs
public partial class blurtest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
lbl.Text = "test msg";
}
}
How can i set the label text here.
|
|
|
|
|
Hi expertzzz
i am working with a searching tool...i am using google API for finding the location ..
that latitute and longitude along with company address i am keeping in database...
i want to list some of nearest companies with my selected location..
eg: i selected a location "Grand Rapids"..from there i want to list the nearest location with in the specified kilometer range(eg:100 KM).
Regards
Rajeesh MP
|
|
|
|