|
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.
|
|
|
|
|
Hi..
After I copied some web applications from a computer to another each time I open one of them an error message appear:
The project is on an untrusted web server.Opening this project may cause code to be executed with full trust.Do you want to open this project? yes/no
Then I choose yes and every thing works normally.But why did this message appear?.
Iam using VS 2003 and windows xp professional.
I am too late but i will never give up
|
|
|
|
|
hi guys.. we friends are designin a website tat has a forum.. our prob is tat we need to reciev a mail wenever there's a post made to the website, so that we shd check the post and then put it up only if its legit and neat..
so how do we configure the mail thing in asp.net, C# ? please help me soon peopl..
|
|
|
|
|
When the post is saved in a database run a routine which execute this function, this function must are embebed in the asp.net page, this save the datas in a database, then send then mail to mailing list which contained the admins mails.
Greetings from Mexico
-----------------------
Cuando salga el sol, no estare aqui...
|
|
|
|
|
I would lke to generate an image based from my webpage. Only the top 150 pixels by 40.
Is there a way to take the designated pixels and take a screen shot into an image?
thanks
|
|
|
|
|
Bitmap bmp = new Bitmap(Server.MapPath("web.jpg"));
Graphics g = Graphics.FromImage(bmp);
g.SmoothingMode = SmoothingMode.AntiAlias;
//set Name
g.DrawString(this.txtName.Text,
new Font("Arial", 14), SystemBrushes.WindowText, 110, 10);
//set Title
g.DrawString(this.txtTitle.Text,
new Font("Arial", 8), SystemBrushes.WindowText, 115, 30);
//set Address
g.DrawString(this.txtAddress.Text,
new Font("Arial", 8), SystemBrushes.WindowText, 115, 55);
//set web URl
g.DrawString(this.txtWebURL.Text,
new Font("Arial", 8), SystemBrushes.WindowText, Convert.ToInt16(this.TextBox1.Text), Convert.ToInt16(this.TextBox2.Text));
Response.ContentType = "image/gif";
bmp.Save(Response.OutputStream, ImageFormat.Jpeg);
I figured out how to make this file. How do I make this applicaion download this file instead of displaying it on the screen? Right now it renders the image but when I try to download it windows OS doesnt recognise it as an image.
|
|
|
|
|
I'm still having some issues with sorting a dynamically created Gridview. I have an objectdatasource and a gridview that I set on the fly depending on which report is chosen from a drop down. This is working fine except for when I sort on one report and then try to select another report from the drop down. The GridViewSortEventArgs.SortExpression still holds the value of the previous report's sort column. Is this a futile attemt to change this value? The only place it seems I can clear it is in a custom sort event but that is where I need it. GridView.SortExpression is read only from what I can tell so I don't think I can clear that. Little help?
Darren
|
|
|
|
|
|
hi all,
I am creating image button control dynamically with the appropriate images to its url property.
The problem is i want to identify which image button has been clicked and take appropriate actions according to image clicked. i want to know how to make click event to fire.
if u can provide any exixting code it woud be great for me
i am using asp.net and c#.
i am struck up here,please provide me information on this in detail(if posible along with code)
...
krish
krish
|
|
|
|
|
Register the event dynamically like…
Control.event+=new eventhandler(function);
Thomas
|
|
|
|
|
Hi.
I am trying to set a link conditionally if a piece of data exists.
<code><tr class="bodytext">
<td><a class="grayUrl" href="http://<%#DataBinder.Eval(Container.DataItem, "URL")%>"> <%#DataBinder.Eval(Container.DataItem, "SiteName")%></a>
</td>
</tr></code>
This puts a link on the page... but I only want it there if the database field DataBinder.Eval(Container.DataItem, "Link") is set to true.
I am using .net 2.0 and VB.net
Séan
|
|
|
|
|
Use a server side function to get the URL. Pass the database fields to this function and check there the “Link” is true or false. If the “Link” is true return the concatenated string of “URL” and “Sitename”. If the link is false return the “#”.
Thomas
|
|
|
|
|
Thank you for the answer...
Take it as read that I am a newbie - this code does not work and it is probably because I am doing something wrong:
Dim dbread As OleDbDataReader = dbcomd.ExecuteReader()
Sites.DataSource = dbread
Sites.DataBind()
strNewUrl = check_Review(dbread.GetValue("Review"))
dbread.Close()
dbconn.Close()
End Using
End Sub
Private Function check_Review(ByVal review)
Return ("<%<a class='grayUrl' href='http://<%#DataBinder.Eval(Container.DataItem, 'URL')%>' title='<%#DataBinder.Eval(Container.DataItem, 'SiteName')%>'><%#DataBinder.Eval(Container.DataItem, 'SiteName')%></a>%>")
End Function
End Class
Also - what is the correct method for assigning a new value to the data column as I prepare to write the data to the page? Or am I going about this all wrong?
|
|
|
|
|
Do like this. Don’t copy paste this. Check its integrity
<code><tr class="bodytext">
<td><a class="grayUrl" href='<%# check_Review(DataBinder.Eval(Container.DataItem, "LINK"),DataBinder.Eval(Container.DataItem, "URL"),DataBinder.Eval(Container.DataItem, "SiteName")) %>'</a>
</td>
</tr></code>
code behind....
Private Function check_Review(ByVal link as boolean,ByVal url as string,ByVal sitename as string)
if link then
return "http://" & url & sitename
else
return "#"
end sub
Thomas
|
|
|
|
|
We've just implemented CSS Friendly Control Adapters. We are also using AJAX extensions.
The problem is GridViewAdapter and row's postback. Clicking on a row resuls in "Invalid postback or callback argument. Event validation is enabled using <pages enableeventvalidation="true"> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation." I suspect it’s due to there is no method defined, but I don't have any prove. Before we installed the adapter it worked fine. We were binding some java script on each row. First we thought it was something to to with that. But the error remains even after we disable OnRowDataBound.
Bug? Is there a simple way to solve this?
|
|
|
|
|
ASP.NET 2.0
Need to simply process incoming postback information without sending back a reponse.
Client sends HTML from email to a page on a web site. Web Server ASP generates a response page and send it back which opens the browser on the client.
Email body: User Name:
How to avoid sending back the response page.
Just to clarify the language; by the *response* I mean whatever the web server sends back when it receives a transmission that requests it to process a web page. I suppose that any good listener will send back a reply when it receives a request that it can process. Even if a web server is directed to a page that does not exist it will reply something which will open a browser unless a browser with the existing original session or connection is already active.
I confirmed that even an empty server page capable of processing the incoming data will send enough of a message back to open the browser which displays nothing.
A couple of suggestions have been made by forum members such as:
1 - Using a web service
Can a web service be made to accept a form postback data stream as in
My only experience with webservices used a control to shape the message sent to the web service. I have no idea what the message looked like. For all I know the message might look exactly the same as what is being transmitted by the GET package form this email.
The data part of the message was XML which the web service had to process but the encapsulation for the data might have been the same as any message that a web server can respond to.
The web service did send back results. The result did not open a browser but was caught by the control that sent the original message. The control probably operates as a browser with an open web server session. This control browser session received the send back message as IE or any other browser would.
2 - iHttpHandler.
If a page output was redirected to an HttpHandler that did not contain any HTML page component maybe it would not send back a reply?
How would a browser be closed automatically?
Can we close a browser with a message from the web server?
How does a browser end a session? It moves to a different web site or it is closed.
Is there no way for a browser to terminate a session before a web server sends back a response?
Thanks,
RobGMiller
|
|
|
|
|
You just have to handle the response. However you send a request to the server, you will recieve a response, not mainly because the server will always send one, but because the code sending the request always expects the response. Even if the server is never even reached, the mail program will open a browser window to handle the response.
You can use Javascript to close the browser window, but if the browser considers the window to be the main window (which I think it will), the user has to confirm that the window will be closed.
Why do you want to close it anyway? Don't you think that the user wants some kind of confirmation that the information has reached the server?
---
single minded; short sighted; long gone;
|
|
|
|
|
hai every1...am doing a project in asp.net...my project is getting executed correctly in my system but in my coll it shows an error....its not inserting values into the database...the error it shows is
"operation should use an updateable query"
wats this error basically??? can u help me out in rectifying it pls...
|
|
|
|