|
Dear Satip,
Could u pls. advice me which is the best book to fit needs of all people like biginners to developers. I would be thankfull to you.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
Hi
Well basically I want to create some sort of rating system, usuing the ajax ratng control, below is an overview.
1. User rates page via rating control, selecting 1- 5 stars via clicking on them.
2. The value then tgets stored in a database
3. The top five pages with the highest numbers, a link gets displayed to the web page on the home page
http://www.codeproject.com do something, almost identical to this, but the one thing I dont understand is that the website will have around 1k of pages, therefore wont this be really slow? and how will I add the values up each time a page is rated?
Any help appreciated
Thanks
|
|
|
|
|
using a grid i have created two rows by binding the hidden template field
with a datasource in pageload event,
Now i have to Add a new row in the grid using a button click....maitaining the values in the textbox in the grid entered by user....
=========================
/*
<asp:datagrid id="dgLocsch" runat="server" width="80%" cssclass="lbl_font" autogeneratecolumns="false">
<columns>
<asp:templatecolumn visible="false">
<itemtemplate>
<%# Eval("ROW") %>
<asp:templatecolumn headertext="Day From">
<headerstyle cssclass="sblue">
<itemtemplate>
<asp:textbox id="txtDayFrom" runat="server" width="50px">
*/
coding in page_load event is
===================================
protected void Page_Load(object sender, EventArgs e)
{
Addrow(dgLocsch, 2);
}
private void Addrow(DataGrid dg, int NoOfRows)
{
DataTable dt = new DataTable();
dt.Columns.Add("ROW");
for (int i = 1; i <= NoOfRows; i++)
{
DataRow dr;
dr = dt.NewRow();
dr["ROW"] = i.ToString();
dt.Rows.Add(dr);
}
dg.DataSource = dt;
dg.DataBind();
}
can any one help me......
thank u
|
|
|
|
|
Here is what you can do. Before you bind your grid (on page load, or whenever) store you dataTable in viewstate.
ViewState["yourDataTable"] = dt;<br />
<br />
<br />
private void Addrow()<br />
{<br />
DataTable dt = (DataTable)ViewState["yourDataTable"];<br />
<br />
int row = 0;<br />
<br />
while (row < dt.Rows.Count)<br />
{<br />
<br />
TextBox txt = (TextBox)this.GridView.Items[row].FindControl("txt");<br />
dt.Rows[row]["txtValue"] = txt.Text;<br />
<br />
<br />
row += 1;<br />
}<br />
<br />
DataRow dr;<br />
dr = dt.NewRow();<br />
dt.Rows.Add(dr);<br />
<br />
<br />
dg.DataSource = dt;<br />
dg.DataBind();
I didn't get any requirements for the signature
|
|
|
|
|
thnks....
my requirement is i need a grid with two rows and two cols
with a textbox inside a gridcell....
i have a add button ....
when an user clicks the add button...an extra row has to be generated...the values entered by the user in the textbox should be maintained
i need the complete codings..can u plz send me that....
thank u
|
|
|
|
|
using a grid i have created two rows by binding the hidden template field
with a datasource in pageload event,
Now i have to Add a new row in the grid using a button click....maitaining the values in the textbox in the grid entered by user....
=========================
<asp:datagrid id="dgLocsch" runat="server" width="80%" cssclass="lbl_font" autogeneratecolumns="false">
<columns>
<asp:templatecolumn visible="false">
<itemtemplate>
<%# Eval("ROW") %>
<asp:templatecolumn headertext="Day From">
<headerstyle cssclass="sblue">
<itemtemplate>
<asp:textbox id="txtDayFrom" runat="server" width="50px">
coding in page_load event is
===================================
protected void Page_Load(object sender, EventArgs e)
{
Addrow(dgLocsch, 2);
}
private void Addrow(DataGrid dg, int NoOfRows)
{
DataTable dt = new DataTable();
dt.Columns.Add("ROW");
for (int i = 1; i <= NoOfRows; i++)
{
DataRow dr;
dr = dt.NewRow();
dr["ROW"] = i.ToString();
dt.Rows.Add(dr);
}
dg.DataSource = dt;
dg.DataBind();
}
can any one help me......
thank u
|
|
|
|
|
Hi,
I am new to the built in health monitoring functionality that comes built into the .net framework. I have followed a v.good video tutorial and I cant seem to get the last part of my code to work correctly...
I have configured my app to display an error page (when necessary) and this will write errors to the event viewer along with my custom error messages - this works fine.
My problem is when I try to write these same errors to sql. Here is my code from web config:-
<code><healthMonitoring>
<eventMappings>
<add name="InputValidationEvent"
type="WebEvents.InputValidationEvent, WebEvents"/>
</eventMappings>
<rules>
<add name="InputValidationToSql"
eventName="InputValidationEvent"
provider="SqlWebEventProvider"
profile="Critical"/>
</rules>
</healthMonitoring></code>
Here is the code in my WebEvents assembly class:-
<code>using System;
using System.Collections.Generic;
using System.Text;
using System.Web.Management;
namespace WebEvents
{
public class InputValidationEvent : WebFailureAuditEvent
{
public InputValidationEvent(object sender, string message)
: base(message, sender, WebEventCodes.WebExtendedBase + 1)
{}
public override void FormatCustomEventDetails(WebEventFormatter formatter)
{
base.FormatCustomEventDetails(formatter);
//formatter.AppendLine("This is where you can write custom message for the event logger!");
formatter.AppendLine(string.Format("Actual error exception raised by the PNWeb app : {0}",this.Message));
}
}
}</code>
What happens when an error occurs in my app:-
1) Errors are written to the event viewer - which is ok.
2) In App-Data (within my app) an ASPNETDB.MDF file appears, along with aspnetdb_log.LDF.
It doesn't write the error to the aspnet_webevents_events table which exists in my DB?
So what I need to know is: Why does it write the error to the DB within the App_data folder & NOT to the aspnet_webevent_events table in my database?
Hope I've explained in enough detail - its driving me nuts!
Thanks
Janet
|
|
|
|
|
hi
i bound a textbox in gridview column now i want to get the value of each text box. every row has image button. when i click on image button i want the value of textbox which is present in selected row
Please help me Thanx
|
|
|
|
|
Hi,
I've just worked on something very similar, here is my code:-
protected void _gridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
//find the link button for each row being databound
LinkButton linkButton = new LinkButton();
linkButton = (LinkButton)e.Row.FindControl("_name");
//Needed as the first row is for the headings!
if (linkButton != null)
{
//set its CommandArgument so that this can be referenced in the RowCommand Event of the GridView!
linkButton.CommandArgument = e.Row.RowIndex.ToString();
linkButton.CommandName = "ImageClicked";
}
}
protected void _gridView_RowCommand(object sender, GridViewCommandEventArgs e)
{
if ((string)e.CommandName == "ImageClicked")
(
// Convert the row index stored in the CommandArgument property to an Integer.
int rowIndex = Convert.ToInt32(e.CommandArgument);
// Retrieve the row that contains the Linkbutton clicked from the Rows collection.
GridViewRow row = _gridView.Rows[rowIndex];
//use the findcontrol method
TextBox tb = new TextBox();
tb = (TextBox)e.Row.FindControl("_txtName");
)
}
Hope this helps
Janet
|
|
|
|
|
"\n" is used for next line but we can use for spacing in ASP.NET
as shown below
Name : The Knowledge
Skills : ASP.NET
Thnx in advance
|
|
|
|
|
what is your question ??
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Be clear and Ask your question?
Regards,
Satips.
|
|
|
|
|
You have been a member long enough to know the rules. Naming your message title the same as the message board is completely useless.
______________________
stuff + cats = awesome
|
|
|
|
|
The Knowledge wrote: but we can use for spacing
What's wrong with space?
---
single minded; short sighted; long gone;
|
|
|
|
|
You can't breathe in it
|
|
|
|
|
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
You cannot build a appartment or ride a cycle in it.
Regards,
Satips.
|
|
|
|
|
No-one can hear your scream ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I find myself using "\n" when I'm writing to literals in javascript. I do this, because later when I view the source, to debug it, I get something that's intelligible rather than a single line. Ex:
<asp:literal runat="server" id="JSexample">
----- Later, in code-behind file ------
string jsString = "<script='text javascript'="">\n";
string jsString += "var something='This is something to say.';\n";
string jsString += "alert(something);\n";
string jsString += "\n";
JSexample.Text = jsString;
----- This way, I when debugging it shows up as: ----------
<script='text javascript'="">
var something='This is something to say.';
alert(something);
----- Instead of: ---------
<script='text javascript'="">var something='This is something to say.';alert(something);
This can make a big difference, when the javascript gets to be 50+ lines.
|
|
|
|
|
WTF are you talking about?
If you truly believe you need to pick a mobile phone that "says something" about your personality, don't bother. You don't have a personality. A mental illness, maybe - but not a personality. - Charlie Brooker
My Blog - My Photos - ScrewTurn Wiki
|
|
|
|
|
Are you asking for the HTML equivalent? If so, it's the <br /> tag.
|
|
|
|
|
Hi All, I am facing GridView printing problems those are:
1. How can I get Formatted Contents of a grid using JAVASCRIPT.
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var strOldOne=prtContent.innerHTML;
var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
prtContent.innerHTML=strOldOne;
}
Rightnow it displays all rows of gridview in one row
I tried outerHTML but this displays same GridView as it is in ASPX page. I want text format only with some formating so It can be readable and can be printed.
2. How can I print all rows of multiple page GridView, currently It is printing only the current page of GridView.
Many Thanks
Bajrang Singh
Using .net 2.0 (VS2005)
|
|
|
|
|
Your making this tougher then it is. I would not try to print one section of a page via javascript. Just create a new page with only the content that you wish to print. For example if you want to print only a gridview copy and paste your grivdview into a new aspx page. On page load (re-load the grid) and then print.
Good luck.
I didn't get any requirements for the signature
|
|
|
|
|
Thanks ToddHileHoffer for suggestion.
Is using javascript for a new window that contains that gridView not a good idea
instead a new aspx page that contains printable contents(gridview).
I got almost I wanted to do except one thing that is, if GridView has multiple pages how can I print all pages using a single click. Right now I have to visit every page of that Grid View and then print.
If u have any better and simple idea that can print all pages of GridView, please post me. I will be highly thank full to u.
Bye
Bajrang Singh
Using .net 2.0 (VS2005)
|
|
|
|
|
Turn paging off on your print page. That will lead to the problem of page breaks. You could add a counter in the itemDatabound event in the grid (along with a template column) you could add a page break via .css every 15 records or so. http://www.htmlgoodies.com/beyond/css/article.php/3470341
Although I've never tried that.
I didn't get any requirements for the signature
|
|
|
|