|
Try this
use topmargin="0" in body tag
Cheers!!
Brij
|
|
|
|
|
I have 1 checkboxlist, 5 dropdownlits and three textboxes.I have to write the SQL query and c# code for that advanced search.
<asp:CheckBoxList ID="reposotoryCheckBoxList" runat="server" Style="z-index: 106; left: 226px;position: absolute; top: 18px">
asp:ListItem Text="computer" Value="2"></asp:ListItem>
<asp:ListItem Text="math" Value="3"></asp:ListItem>
<asp:ListItem Text="science" Value="1"></asp:ListItem>--%>
</asp:CheckBoxList><asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Anywhere</asp:ListItem>
<asp:ListItem>Title Words</asp:ListItem>
<asp:ListItem>Creator Name Words</asp:ListItem>
<asp:ListItem>Subject Words</asp:ListItem>
</asp:DropDownList>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
<asp:DropDownList ID="DropDownList2" runat="server">
<asp:ListItem>and</asp:ListItem>
<asp:ListItem>or</asp:ListItem>
<asp:ListItem>not</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="DropDownList3" runat="server">
<asp:ListItem>Anywhere</asp:ListItem>
<asp:ListItem>Title Words</asp:ListItem>
<asp:ListItem>Creator Name Words</asp:ListItem>
<asp:ListItem>Subject Words</asp:ListItem>
</asp:DropDownList><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br />
<asp:DropDownList ID="DropDownList4" runat="server">
<asp:ListItem>and</asp:ListItem>
<asp:ListItem>or</asp:ListItem>
<asp:ListItem>not</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="DropDownList5" runat="server">
<asp:ListItem>Anywhere</asp:ListItem>
<asp:ListItem>Title Words</asp:ListItem>
<asp:ListItem>Creator Name Words</asp:ListItem>
<asp:ListItem>Subject words</asp:ListItem>
</asp:DropDownList><asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
The dropdown list items are from different table, Title from tblTitle,Subject from tblSubject and createrName from tblName.
Any help will be highly appreciated.
Thanks
|
|
|
|
|
I did this and I have problem to select the different table from dropdownlist.
here is my sql query:(inside the App_Code)
public static DataSet GetReport(String repository, String name, String title, String subject)
{
String sql = " Select distinct col.ID,col.CollectionAbstract,col.Title,col.SortTi tle,col.Scope,col.CollectionIdentifier from tblCollections_Collections col" +
" LEFT JOIN tblCollections_CreatorIndex colCI " +
" ON col.ID = colCI.CollectionID " +
" LEFT JOIN tblCreators_Creators cr" +
" ON colCI.CreatorID = cr.ID " +
" LEFT JOIN tblCollections_SubjectIndex sbI " +
" ON col.ID = sbI.CollectionID " +
" LEFT JOIN tblSubjects_Subjects sub " +
" ON sbI.SubjectID = sub.ID " +
" where ( 1=1 )" + //
(repository == null || repository.Trim() == "" ? "" : " and col.RepositoryID in( " + repository + " )") +
(title == null || title.Trim() == "" ? "" : " and col.Title like '%" + title + "%'") +
(name == null || name.Trim() == "" ? "" : " and cr.Name like '%" + name + "%'") +
(subject == null || subject.Trim() == "" ? "" : " and sub.Subject like '%" + subject + "%'")+
" order by col.Title";
return SqlHelper.ExecuteDataset(GetConnectionString(), CommandType.Text, sql);
}
aspx.cs file contains:
protected void Button1_Click(object sender, EventArgs e)
{
try
{
String repository = "";
Boolean first = false;
if (reposotoryCheckBoxList.Items[0].Selected == true)
{
repository = " 1,3,5";
}
else
{
first = false;
for (int i = 0; i <= reposotoryCheckBoxList.Items.Count - 1; i++)
{
if (reposotoryCheckBoxList.Items[i].Selected == true)
{
if (first == false)
{
repository = reposotoryCheckBoxList.Items[i].Value.ToString();
first = true;
}
else
{
repository = repository + " , " + reposotoryCheckBoxList.Items[i].Value.ToString();
}
}
}
}
......My questions .....how to implement that 5 dropdownlists here..............???.......
string str = TextBox1.Text.ToString();
string str1 = TextBox2.Text.ToString();
string str2 = TextBox3.Text.ToString();
str = str.Trim();
str1 = str1.Trim();
str2 = str2.Trim();
//throw new Exception();
DataSet ds;
ds = DataAccess.GetReport(repository, str1, str, str2);
Repeater1.DataSource = ds;
Repeater1.DataBind();
}
I have problem to handle these dropdownlists.Any help will be highly appreciated.
Thanks for your help.
|
|
|
|
|
Hello All,
We're deploying a .net 2.0 web application to a windows 2003 server running IIS. It currently has various .net 1.* running on it. We created a seperate threading pool, insured the framework was installed, registered it to use .net 2.0, through the app on, and we're getting a rather odd error. The event log states "Failed to execute request because the App-Domain could not be created.Error 0x80131522" We have this app running in similar environments with no issues.
Any ideas would be greatly appreciated,
Thanks,
Ryan
|
|
|
|
|
hi, what i am trying to do is , when a button is clicked a row should be added containing one column with a textbox in gridview.
For that i have used datatable for binding,, but i am unable to get the added textbox reference using find control method
here is my cs code.
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
loadDynamicGrid();
}
}
private void loadDynamicGrid()
{
DataTable dt = new DataTable();
DataColumn dcol = new DataColumn();
dcol.ColumnName = "gggg";
dt.Columns.Add(dcol);
DataRow drow = dt.NewRow();
dt.Rows.Add(drow);
GridView1.DataSource = dt;
GridView1.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
DataTable dt = new DataTable();
DataColumn dcol = new DataColumn("gggg");
dt.Columns.Add(dcol);
foreach (GridViewRow gvr in GridView1.Rows)
{
DataRow drow= dt.NewRow();
TextBox tt = (TextBox)gvr.Cells[0].FindControl("Text1");
drow[0] = tt.Text;//Here gives error as it is always null
dt.Rows.Add(drow);
}
DataRow dr = dt.NewRow();
dr[0] = "";
dt.Rows.Add(dr);
GridView1.DataSource = dt;
GridView1.DataBind();
}
protected void GridView1_RowDataBound1(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
TextBox tb = new TextBox();
tb.ID = "Text1";
tb.Text = "chanu";
e.Row.Cells[0].Controls.Add(tb);
}
}
}
//here is my aspx code
]]>
<title>Untitled Page
<asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">
<asp:updatepanel id="UpdatePanel1" runat="server" xmlns:asp="#unknown">
<contenttemplate>
<asp:gridview id="GridView1" runat="server">
Width="200px"
onrowdatabound="GridView1_RowDataBound1" >
<columns>
<asp:button id="Button1" runat="server" onclick="Button1_Click" text="Button">
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
i have show data in gridview
now i want to Export that data to Excel on click of button so user can save it.
|
|
|
|
|
|
thnx
|
|
|
|
|
Hi,
please tell me how to validate ” dd/mm/yyyy” date format using comparevalidator…
|
|
|
|
|
|
If I hadn't just wrote it I would never post it.
<asp:CompareValidator id="DateValidator" runat="server" Type="Date" Operator="DataTypeCheck" ControlToValidate="TextBox1" ErrorMessage="!" />
|
|
|
|
|
i am reading from a gridview that have atleast 10 rows
i want to insert all rows at a time how can i do it without using any loop.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
How Can I convert MM/dd/yyyy format into dd/MM/yyyy and the date.
using Asp.net 2.0 with c#
|
|
|
|
|
Use the DateTime.ParseExact method to parse the string into a DateTime value, then use the ToString method on the value to format it into the desired string.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I am developing website...I want to display 3 table details using Tab control...I am using following code..but its displaying different position..i wnt to display with same position...
function VisibleMe(no)
{
//alert("test");
document.getElementById("div1").style.visibility = "hidden";
document.getElementById("div2").style.visibility = "hidden";
document.getElementById("div"+no).style.visibility = "Visible";
document.getElementById("div"+no).style.left = 0+"px";
document.getElementById("div"+no).style.top = 0+"px";
//document.getElementById("tabtd").innerHTML=document.getElementById("div"+no).innerHTML;
}
<table>
<tr><td>
<div id="div1" style="overflow:scroll;width:814px;position:absolute;">
<table width="1600" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td valign="middle" width="110"><div class="client">PublisherName</div></td>
<td valign="middle" width="110"><div class="client">AdName</div></td>
<td valign="middle" width="120"><div class="client">ServedImpressions</div></td></tr>
</table></div>
<div style="overflow:scroll;width:814px;position:absolute;" id="div2">
<table width="2000" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td valign="middle" width="110"><div class="client">PublisherName</div></td>
<td valign="middle" width="110"><div class="client">InteractionRate</div></td>
<td valign="middle" width="170"><div class="client">InteractionAverageDuration</div></td></tr>
</table></div>
</div>
<table border="0">
<tr>
<td id="td1" onclick="VisibleMe(1)"><b>Creative Summary</b></td>
<td id="td2" onclick="VisibleMe(2)"><b>Engagement</b></td>
</tr>
<tr><td valign="top" align="left" bgcolor="#FCFCFC" colspan="3">
<span id="tabtd"></span>
</td>
</tr>
</table>
</td></tr></table>
if anybody knows..plz reply me..
Thanks
Raaj
|
|
|
|
|
Try to change the display style. Even if you change the visibility of the control, it will occupy the area for rendering it.
*jaans
|
|
|
|
|
I changed position equalto relative and absolute....but I couldnt get
Raaj
|
|
|
|
|
I asked you to change style.display .The code will be
document.getElementById("div1").style.display = "none"; for making it invisible and
document.getElementById("div1").style.display = "block"; for making it visible.
*jaans
|
|
|
|
|
Hi,
I am using ASP,NET 2.0,
In my application,I have to save file through Client Call Back.
Can any one help me in this regards
thanks
|
|
|
|
|
How to retain hyperlink color when clicked?
Thanks in Advance.
|
|
|
|
|
Check out a:visited, that is what you are trying to set.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi Bob,
Thanks for your reply.
I have written the script as follows
a:link {
COLOR: #0000FF;
}
a:visited {
COLOR: #800080;
}
a:hover {
COLOR: #FF0000;
}
a:active {
COLOR: #00FF00;
)
when I click on a link..its color gets changed and redirects to some xyz.apsx page(assume).Now the link color gets refreshed in that page.I need to retain the color of link (i.e visited color) in redirected page.
how can this be done?
Thanks in advance.
|
|
|
|
|
The honest answer, I have no idea off the top of my head. Sorry
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hy,
can i add a dropdown list to a celender control so that i can select month and year directly from the drop down list without clickng on NEXT all the time(as it takes a lot of time).
Alernative solution to this problem are welcome
|
|
|
|
|
For this you have to customise lika below
Add a row above to calender control and add two dropdown in the that row one for month and another for year and on OnSelectedIndexChanged event of both set the calendar control Selected value like
int Year = Convert.ToInt32(ddlCalYear.SelectedItem.Text);
int Month = ddlCalMonth.SelectedIndex + 1;
myCalendar.VisibleDate = new DateTime(Year, Month, 1);
Cheers!!
Brij
|
|
|
|