|
you need to read a VERY basic book on ASP.NET, because it's clear you have no idea what it is, or what it does. An ASP.NET application can only run on a web server that has ASP.NET. It gets to users via the web, that's what ASP.NET is for,
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
@ Christian Graus
Thankyou so much for your kind information...
|
|
|
|
|
Hi im using VS2008 to upload and display images.
I have a control with an <asp:Image control in it... if i save the image to a file on the server and specify the ImageUrl of the control it works fine.
however i want to avoid writing the image to a file before displaying it.
first of all, can I use the <asp:Image control to display the output of a httphandler or do i need to use something like
<img alt=""httpHandler"" src=""../App_Code/ImageHandler.ashx?productid={0}"">
secondly, what if anything do i need to add to the web config? - under HttpHandlers if I add
<add verb="*" path="*" type="ImageHandler"/>
then the actual pages are not loaded - just the results of the http handler as soon as the page loads
(I guess this tells me the actual HttpHandler works as the image is displayed)
the control that wants to use the HttpHandler is in a 'Controls' directory, the HttpHandler is in the 'App_Code' directory
the ImageHandler.ashx file is:
<%@ WebHandler Language="C#" Class="ImageHandler" CodeBehind="ImageHandler.cs" %>
the ImageHandler.cs file is:
using System;
using System.Web;
using DataLinq;
using BLL = BusinesLogic;
public class ImageHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
int _productID;
if (context.Request.QueryString["productid"] != null)
{
_productID = Convert.ToInt32(context.Request.QueryString["productid"]);
}
else
{
throw new ArgumentException("No parameter specified");
}
Product product = BLL.ProductBLL.GetByID(_productID);
if (product != null)
{
context.Response.ContentType = "image/jpeg";
context.Response.BinaryWrite(product.Image.ToArray());
}
}
public bool IsReusable
{
get
{
return false;
}
}
}
Thanks,
Chas
modified on Monday, August 24, 2009 3:22 PM
|
|
|
|
|
ok managed to get this working...
The HttpHandler ashx and cs files didnt need to be seperated and the ashx file needed to be in a different directory to App_Code
I put it in a new directory called HttpHandlers...
I couldnt figure out how to use the handler with an asp:Image control (if anyone has the answer to this that would be great) so i used the img control specifying the src (wrapped in a div specifying the innerHtml)
Cheers,
Chas
|
|
|
|
|
The typical way to do this, is to write a page that takes an id on the URL, and returns the bytes of the image from the db. Then your image source url will be something like myhandler.aspx?id=23
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
When working with multiple monitors I need the user to select which monitor they are working on...any idea how I can show them a list of monitors from there machine?
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
Try to use:
screen.width
screen.height
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
You can tell the width and height of the screen, as someone said, but there is no way you can enumerate monitors with js
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I figured...but thought it was worth a try thanks for the help
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
Hello to all
I want to fix the page width in asp.net. when I add a banner to masterpage.master or add menu the width of page always changed.
Please help me how I can fix the page width?
Thanks a lot.
A good friend tell that use table. but I use it with no luck.
Are there any good article about working with table?
modified on Monday, August 24, 2009 5:52 PM
|
|
|
|
|
I think you can try wtih the Table width. That may restrict your page width.
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
when panel is used for scroll bar in gridview it is working fine
But when the window is resized it is not woking in the header of gridview
raj for u make u problem free
|
|
|
|
|
Member 4295042 wrote: it is not woking in the header of gridview
Not working means what ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Actulally my gridview header is not moving with respect to grid when window is resized
header class i have written is
css
{
position:relative;
top:expression(this.ParentNode.ParentNode.ParentNode.Scrolltop-2);
}
i have placed the gridview in panel
raj for u make u problem free
|
|
|
|
|
How to use BindingmanagerBase class for nevigating recards,i have some idea in c#(windows Application)but not in asp.net
|
|
|
|
|
You can't use that in ASP.NET. ASP.NET is stateless and got a different architecture than the rich-client applications.
|
|
|
|
|
Please tell me whats the use of save icon in FCK editor
|
|
|
|
|
suzzain wrote: Please tell me whats the use of save icon in FCK editor
Use of a save icon is obvious, isn't it?
|
|
|
|
|
|
Read this[^]. Especially point 2 and rephrase your question.
|
|
|
|
|
Hi All,
I M trying to connect to access database it is done and working perfectly in my local machine.
But when i upload the pages to web server it is retrieving the data from database but does not allow saving the data
so could you please tell me how can i solve this problem.
Thanks in advance.
|
|
|
|
|
Define any web form, then you established connection with any provider after this create command for
accessing query and finaly define datareader class.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=c:/db1.mdb;");
con.Open();
OleDbCommand cmd = new OleDbCommand("select *from login", con);
OleDbDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
if (TextBox1.Text == dr.GetString(0))
if (TextBox2.Text == dr.GetString(1))
Response.Redirect("default2.aspx");
else
lbl.Text="check the username and password";
CheckBox1.Text = "check the username and password";
}
//con.Close();
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
}
}
|
|
|
|
|
Dhrumil_Shukla wrote: web server it is retrieving the data from database but does not allow saving the data
Its means your connection string is not valid. Do you have the database on web server or any different system ? What your connectionString contains?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
my datbase is on web server and the connectionstring is like
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|table.mdb;Persist Security Info=True"
|
|
|
|
|
Hi,
I am having a requirement like 'Scheduling Jobs' in a ASP.Net web site. Each user can create 'N' number of projects & schedule each project to run in a particular interval (Daily/ Weekly/ Monthly/ etc). Similarly we have 'N' number of users.
Each user needs to Edit/ Delelte the scheduled jobs & View the status.
One of my colleague suggested the below. Does any one of you have used this open source framework?
http://quartznet.sourceforge.net/[^]
Can you please suggest on this?
Jey
modified on Wednesday, August 26, 2009 5:04 AM
|
|
|
|