|
plz any one help me regarding storing image file binary info in to a text file. and also again read that text file and form a image.....its urgent plz
Pradeep Reddy
|
|
|
|
|
FileStream fileStream = new FileStream("c:\\Admin.jpg", FileMode.OpenOrCreate, FileAccess.Read);<br />
<br />
long len;<br />
<br />
len = fileStream.Length;<br />
<br />
Byte[] fileAsByte = new Byte[len];<br />
<br />
fileStream.Read(fileAsByte, 0, fileAsByte.Length);<br />
<br />
<br />
FileStream fs = new FileStream(Server.MapPath("c:\\a.txt"),FileMode.Create); <br />
BinaryWriter bw = new BinaryWriter(fs);<br />
bw.Write(fileAsByte);<br />
fs.Close();<br />
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
Thank u
Pradeep Reddy
|
|
|
|
|
Hi Experts,
GOOd Morning,
This is regarding view state and hidden field in asp.net
I have storing information in viewstate["strInfo"]="hello world" in page1
my doubt is can i get access to viewstate["strInfo"] in another page? if not pls give clarification.
i read in some book Hidden field can post information to another page. If it is yes Why can't viewstate it is also stored in hidden field only
Pls give clarification asap.
Thanks in Advance
|
|
|
|
|
If it's urgent, please use "Session" or "Cache" instead of ViewState.
I dont think that ViewState can be accessd from another page. cuz the ViewState is stored in the hidden field by using algorithm. so, if you are going to another page, the value of this hiddenfield wont be avaliable in another page.
so, maybe. you can use Session. eg: Session("a") = "Hello World!"
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi,
Even though ViewState information is stored in a hidden field (__VIEWSTATE) in the page, you need to remember that the information is in encrypted state. Also the information is page specific, so if you try to access some other page's ViewState information in some other page only, then you won't be able to retrieve any value.
"On all page visits, during the save view state stage the Page class gathers the collective view state for all of the controls in its control hierarchy and serializes the state to a base-64 encoded string. (This is the string that is emitted in the hidden __VIEWSTATE form field.) Similarly, on postbacks, the load view state stage needs to deserialize the persisted view state data, and update the pertinent controls in the control hierarchy."
I hope that answers your nice question
Thanks and best regards
Omkar Ghaisas
|
|
|
|
|
ViewState is for a single page.
|
|
|
|
|
Hi,
I'm using RadioButtons in datagrid But When I select one I can't unselect it and when I select the others they cannot unselect the other instead they are selected all at once. how could I go about this to be able select one at a time. these Radio button are in one column.
Thanks.
|
|
|
|
|
Try using the name property of the radio btn or radiolist button!!
Gautham
|
|
|
|
|
Thanks Gautham
I'm having another problem. My dataGrid has three different columns. two of them are supposed to be for inserting data and before I inserted the radiobuttonlist it was inserting data very well but after inserting the radiobuttonlist my datagrid cannot insert data any more why isit so? To insert I was using The edit,Update and delete column.
Thanks.
|
|
|
|
|
I have a web user control that is dynamically added to a placeholder on my aspx page.
My user control has a gridview.
I have written code that binds the gridview to a database when the "control" is loaded.
The load event gets fired when the user control is loaded but the gridview doesnt get bound to the database
Please help its urgent
-- modified at 2:17 Friday 2nd March, 2007
Regards
|
|
|
|
|
|
Hi All,
I am facing some problem in GridView Paging. Below is the code, I have written in my code behind. (ASP.NET 2.0 and VB.NET)
I have set the 'AllowPaging' property of Gridview to true. Pagers are Displayed at the bottom. But when I am trying to navigate between the pages, Paging in not working. Only the First Page is always Displayed.
How can I solve this? pls guide me. Thanks
Dim ds As DataSet
Protected Sub displayData()
'Dataset if Poulated
gridView.DataSource=ds.Tables(0)
gridView.DataBind()
End Sub
Protected Sub gridView_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles gvChangeStatus.PageIndexChanging
gridView.PageIndex = e.NewPageIndex
End Sub
Regards,
Jay
|
|
|
|
|
Hi,
Inside the Protected Sub gridView_PageIndexChanging, alongwith setting the newpageindex, you will also need to bind the grid again.. because thats the step where each and every row of the grid gets bound with new data.
Thanks and best regards
Omkar Ghaisas
|
|
|
|
|
Hi,
Iam trying to create a datagrid within a datgrid!! The page is of complex design so there are lots of tables... in that i got to have one more datagrid!
I have tried it and bound some data too but i could see the internal datagrid!!
Either i can see the internakl datagrid at the design level!!
Am i missing something??
thanks!
Gautham
|
|
|
|
|
|
only subject is there....whats ur problem...
Describe it more..;P
Dotnet
|
|
|
|
|
Dear All,
My project has this files - Web.config, Global.asax
What are the important in here.
I need get complete idea about content in this file.
Any one can pls give clear idea or submit articles or links.
And also give idea about Forms Authentication / Windows Authentication ?
Regards
Kusal
|
|
|
|
|
|
I want to show the number of rows in a datatable. I'm still a bit new, but thought there would be something similar to Items.Count that returned the total items/rows in the table. I'm looking to do this in C#. thanks!
|
|
|
|
|
This should do it:
DataTable.Rows.Count;
Ben
|
|
|
|
|
Use the datatable.count method. Add it after you filled the datatable.
Dim rwCount as string = DataTableName.Rows.Count.toString()
|
|
|
|
|
Hello all,
I have a gridview and a menu that I can not get to show just white text. I thought I specified the font colors for the column headers of the gridview in my .css file but the default hyperlink colors are taking control instead. Same thing with my menu although I'm not so sure where to change font color for my menu items. I know I'm missing something simple and I really want just what is on the code project's menu with white menu text and I want it to stay white even after the user visits. Any help is greatly appreciated.
menu...
<asp:Menu ID="Menu2" runat="server" DataSourceID="SiteMapDataSource1" Orientation="Horizontal"
DynamicVerticalOffset="2" Height="20"
StaticEnableDefaultPopOutImage="false" StaticItemFormatString="&nbsp {0} &nbsp">
<StaticMenuStyle BorderStyle="None" BackColor="Gray"/>
<StaticMenuItemStyle ForeColor="Black"
BorderColor="#D9D9E6" BorderStyle="Solid" BorderWidth="1px"
Font-Size="10pt" />
<DynamicMenuStyle BorderStyle="Outset" BorderWidth="1px"
BorderColor="White" BackColor="#D9D9E6" />
<DynamicMenuItemStyle Font-Names="Tahoma" Font-Size="8pt"
BorderStyle="Solid" BorderWidth="1px" BorderColor="#D9D9E6" />
<StaticHoverStyle BackColor="Ivory" BorderStyle="Solid" BorderWidth="1px"
BorderColor="#D9D9FF" />
<DynamicHoverStyle BackColor="Ivory" BorderStyle="Solid" BorderWidth="1px"
BorderColor="#D9D9FF" />
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1"
runat="server" ShowStartingNode="false"/>
gridview column header issue...
<asp:GridView ID="GridView1" runat="server" CssClass="DataWebControlStyle" AutoGenerateColumns="True" AllowSorting="true" OnSorting="GridView_Sort" OnSorted="GridView_Sorted">
<HeaderStyle CssClass="HeaderStyle" />
<AlternatingRowStyle CssClass="AlternatingRowStyle" />
</asp:GridView>
.css file
.HeaderStyle
{
background-color: #005eff;
color: White;
font-weight: bold;
}
Darren
|
|
|
|
|
Hi,
One of the solutions that I had used is this..(though there may be others to do the same stuff)
Add the following script to the page where you want the white effect
<%-- <style type="text/css">
<!--
td#MenuTD a:link{color:White;}
td#MenuTD a:visited {color:White;}
-->
</style>--%>
where the MenuTD is the id of the TD which contains the Menu control in the .aspx page. This style only applies to the MenuTD's hyperlinks and not to other hyperlinks on the page.
This effect mainly occurs because when the menu is rendered on screen, then its rendered as a hyperlink (if you see in page's viewsource) and you must be knowing that hyperlinks have by default blue (if not changed in IE).
I think that answers your doubt and problem.
Thanks and best regards
Omkar Ghaisas
|
|
|
|
|
Thanks Omkar! I was missing a:link and a:visited in my style sheet so nothing was happening. Much appreciated.
|
|
|
|