|
Here is the sample code to show in page from database which i used earlier..!
byte[] arrContent = null;
DataTable dt = new DataTable();
DataRow dr = default(DataRow);
int id = Convert.ToInt32(Request.QueryString["id"]);
dt = PlayerInfo.ImagSelect(username);
dr = dt.Rows[0];
arrContent = (byte[])dr["photo"];
int length = arrContent.Length;
Response.ContentType = "image/JPEG";
if (length!=0)
Response.OutputStream.Write(arrContent, 0,length);
Response.End();
You can check this link to sample Image Control..!
ships_agr wrote: i connected the adrotator to sqldatasource through a configure datasource wizard and when i tested the query there in wizard it worked f9...but on running the application no image is displayed in adrotator
It Should be converted to binary format .You can visible the image thr wizard but not in page..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hi All,
I want to store viewstate of entire page. Then on next visit to a page I want it to restore it's state by applying the viewstate I had stored. I found this article very helpful for this Persisting the state of a web page[^]
However it did not solve my problem completely. This article shows how to store viewstate an POST data of a page and then restore it back using stored data. To restore data from POST you need to turn off some security feature. I can't do that so I removed the code which was responsible to store and restore POST data. So now I have a code which just stores viewstate and restores it back.
With this change most of the things started working for me but RadioButtonList is not able to maintain the selected item. With some more experimentation I found out that selected item of RadioButtonList is not stored in viewstate, it is stored in POST data. Is this a correct conclusion?
If it is correct then does that mean I will not be able to restore page completely by storing only viewstate?
Regards
Shrikant
|
|
|
|
|
I don't see the point in this. If you want to restore the page then persist the values and set the controls appropriately when restoring.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yes you are correct, I can do that by writing a code which will handle storing restoring values for each control. But that code will have maintainaece problem, everytime I add new control I will need to change the code.
Also if I can figure out a way to store restore page state it can be applied to multiple pages with lesser efforts.
-Shrikant
|
|
|
|
|
Shrikant Kale wrote: everytime I add new control I will need to change the code
If you are constatnly adding new controls to a page then you need to evaluate your design process.
Shrikant Kale wrote: writing a code which will handle storing restoring values for each control
Ever heard of databinding?
I stand corrected. I said I saw no point in this, now I see the point is laziness and ineptitude.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
My idea was to have a generic way to restore the state of page. If this is possible then I think it will be helpful.
Thanks for your comments.
|
|
|
|
|
You might give a try 'override'ing LoadViewState and SaveViewState() method of your webpage. This methods will allow you to store you custom viewstate to store and retrieve ( of cource your ways of implementation may be storing in Db and retrieving from there or in other way that you may prefer.).
NB: More after I read the link you have refered to: I posted my above reply before I read the location that you refered to. After reading that article I am thinking what difficulty you are facing adding couple of items like selected radio button list. I apolozise if my post does not make sense.
Thanks,
Arindam D Tewary
|
|
|
|
|
Hi friends,
help me to get multiple reports
i have created two crystal reports, one using 'bar chart' and second using 'pie chart', i have implemented in two different web pages, then the result is exported to two individual pdf files...
now, user asking me to build the two charts in one pdf file only, in 2 pages
how can i ??
do some needful friends...
icanmakeiteasy
|
|
|
|
|
Combine the two PDFs using a .Net PDF manipulation library like iTextSharp.
|
|
|
|
|
Location_id Parent_id Location_name
29 3 Rahway, NJ (Time Zone:EST)
3 0 United States
30 29 126 E. Lincoln Avenue
5 3 North Wales, PA (Time Zone: EST)
6 3 Whitehouse Station, NJ (Time Zone: EST)
7 5 351 North Sumneytown Pike
8 7 Upper Gwynedd
31 30 Rahway
32 3 West Point, PA (Time Zone:EST)
11 6 One Merck Drive
12 11 Whitehouse Station
33 32 770 Sumneytown Pike
34 33 West Point
35 0 United Kingdom
36 0 Germany
37 36 Munich
38 37 85540 Haar
39 38 Lindenplatz 1
40 0 Japan
41 40 Tokyo
42 41 Chiyoda-ku
43 42 Kitanomaru Square
44 43 1-13-12 Kudan-kita-Room 1425-E
45 0 Singapore
46 45 #10-03/10 Parkview Square
47 46 600 North Bridge Road-188778
48 3 San Francisco, CA
49 48 Sirna-SF-314
50 0 Brazil
51 0 Italy
52 51 Rome
53 52 VIA PONTINA KM 30, 600
54 0 Canada
55 54 16711 TRANS-CANADA HIGHWAY
56 55 Montreal H9H 3L1
57 48 1700 Owens Street, 3rd Floor - 94158
58 3 Boston, MA (TimeZone:EST)
59 58 33 Avenue Louis Pasteur
60 59 Boston<pre>
question is how to get United States child location?
relation is,
United States ID is 3,
so find out all the parent_id with '3'
ex:[North Wales, PA (Time Zone: EST)] parent_id is '3' location_id is '5'
now if any location's parent_id is '5', then that is also UnitedSates children
<pre>
3 0 United States
5 3 North Wales, PA (Time Zone: EST)
6 3 Whitehouse Station, NJ (Time Zone: EST)
7 5 351 North Sumneytown Pike
8 7 Upper Gwynedd
how to get all the locations under 'United Sates'
icanmakeiteasy
|
|
|
|
|
U can try this
------------------
DECLARE @Location_ID INT
SELECT @Location_ID = 3
;WITH ret AS(
SELECT *
FROM Locations
WHERE Location_ID = @Location_ID
UNION ALL
SELECT t.*
FROM Locations t INNER JOIN
ret r ON t.Parent_ID = r.Location_ID
)
SELECT *
FROM ret
|
|
|
|
|
DECLARE @Location_ID INT
SELECT @Location_ID = 3
;WITH ret AS(
SELECT *
FROM Locations
WHERE Location_ID = @Location_ID
UNION ALL
SELECT t.*
FROM Locations t INNER JOIN
ret r ON t.Parent_ID = r.Location_ID
)
SELECT * FROM ret
icanmakeiteasy
|
|
|
|
|
Error here
Msg 156, Level 15, State 1, Line 5
Incorrect syntax near the keyword 'WITH'.
icanmakeiteasy
|
|
|
|
|
function asdf() {
getScrollHeight();
var obj = document.getElementById("popup");
obj.style.display = "block";
obj.style.top = getScrollHeight();
obj.style.left = 200;
}
function getScrollHeight() {
var h = window.pageYOffset ||
document.body.scrollTop ||
document.documentElement.scrollTop;
return h ? h : 0;
}
icanmakeiteasy
|
|
|
|
|
Hello -
I hope someone can help me with this. I have ajax modal popup extender, and when the popup will be open I want the surrounding of the window to be with black background. Can someone help me with that?
Thx, Laziale
|
|
|
|
|
Are you using the BackgroundCssClass property?
|
|
|
|
|
no i am not using background proprty how it use?
|
|
|
|
|
refer this and add style for the extender ...
http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/ModalPopup/ModalPopup.aspx
|
|
|
|
|
Hi everybody, I made an application in asp.net using c# in vs 2003, so now we are using VS2008. In this application I have a class that generates charts and with the old framework everything worked fine, but now in the framework for vs 2008 it not runs! when I run the site and make the request of the chart I get the message below:
Failure Recovery COM class factory for component with CLSID (0002E55D-0000-0000-C000-000000000046) due to the following error: 80040154.
The class that generates charts does reference of Microsoft.Office.Interop.OWC11.dll, I've searched on other sites and discussion groups and not got a solution for my case ... Some say that I must register the dll, others say you should give access to the COM object clsid (0002E55D-0000-0000-C000-000000000046) ....
Anyone know something that can be done?
Thanks
Felipe, Brazil
|
|
|
|
|
|
hi iam using asp.net with c#
in my gridview 1st column is templatefield which contains check box control,
default i set to check, iam displaying data at page load event
but when i unchecked the checkbox then that row should be remove from gridview .
can you give me example which helps me
|
|
|
|
|
Check.. This may help you link
|
|
|
|
|
So for that, use rowcommand event and when user uncheck the checkbox then remove it from db and bind the grid again.
for details on rowcommand event, have a look to the link Click here
|
|
|
|
|
for (int i = 0; i < GridView1.Rows.Count; i++)
{
CheckBox ck=(CheckBox)GridView1.Rows[i].Controls[0];
if(!ck.Check)
{
GridView1.Rows[i].visible=false;
}
}
modified 27-May-14 4:38am.
|
|
|
|
|
Dear All,
I am exporting grid view to excel using following code
void Export()
{
string attachment = "attachment; filename=Contacts.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
GridView1.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
}
but what happens, It exports all the control to excel. I have button, listbox and other controls above my GridView but when exporting I want to export only my gridview to Excel
using above code all the page is exported,
any ideas how to export only gridview to excel?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|