|
I can't see any way of getting the control because it isn't a part of the pages controls but you should be able to get the value from the Request.Form collection after postback.
|
|
|
|
|
lvq684 wrote: 1. i get a string from a webservice (session): string boxstring = "";
This really doesn't make sense to me. What is the purpose of this webservice? The html is useless, it doesn't have any context.
Since the control is being added to the innerHtml of the div at runtime it is not available during postback; it isn't part of the page's control collection.
You could accomplish what you are asking by using a Panel in place of the div, or adding the runat=sever attribute to the div you have
TextBox txt = new TextBox();
div.Controls.Add(txt);
Since it is being added dynamically you must recreate the control during postback but then you could access it's value.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I am working on an application where I have to Drag n Drop selected item from DropDownList, I can successfully drag n drop items from selected list but I have a issue with mouseup event.
The problem is that when I leave the dragged object mouseup event of that object fires, now what I want to do is to fire the event of the control where I am dropping item.
One more thing, controls where I am dropping items are not fixed, they vary. Now I want to get the Id of the control where the element is dropped.
Thanks in advance.
|
|
|
|
|
To get the id of the item being dragged you could try storing it's id on the mouse down event, and then using it on the mouse up. To get the id of the control the item is being placed into, try using a hover event to set an id and then use that.
-Dan
|
|
|
|
|
Configuration:
Application server : windows 2008 server R2 - 64 bit
Oracle client 10g : 64 bit
Visual Studio 2010 : 64 bit
Client side : 32 bit-XP
Successfully running the code on application server for oracle connectivity.
But after IIS configuration of application server while accessing application from client side not
connecting with oracle database.
It does not display the reports generated from Oracle on 32-bit XP
But it shows on 64-bit Win Server 2008.
Anybody help me??
I have never failed,I just found 1000 ways that never works.
Regards,
Victory.
|
|
|
|
|
Hi,
I have a Temp Folder in my solution and i copied one file into Temp Folder, i need to open copied file through code.
I tried with File.Open(),but it is not opening file.
Please suggest me better way to do this.
Regards
Vishnu
|
|
|
|
|
string content = System.IO.File.ReadAllText("myFile.txt");
---------------
<a href="http://www.serverside.no">www.serverside.no</a>
|
|
|
|
|
vishnukamath wrote: I tried with File.Open(),but it is not opening file.
Are there any exceptions? Showing what you have done may help us to point out problems/solutions.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
What is the meaning of "Open" file?
You want to open it reader or you want to execute file?
(suppose i have a word document and you want to open it with Microsoft Word or in memory)
sunaSaRa Imdadhusen
+91 99095 44184
+91 02767 284464
|
|
|
|
|
If it is a ASPNET based solution (a website), you will need proper permissions to access temp folder. Check the app pool for your web site and identity/logon-user under which app pool is running. Make sure the identity has rights to access temp folder and files under that folder.
|
|
|
|
|
Hi Guys,
I have an adv banner , I want to calculate Number of user who click on banner.
|
|
|
|
|
OK, but do you have a question?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Store a count somewhere, increment by one each time it is clicked.
Where is your problem?
|
|
|
|
|
Are you trying to track the number of times the banner is clicked, or the number of individual users who've clicked on the banner? The two aren't necessarily the same.
|
|
|
|
|
Agreed..., but that is more or less just a filtering mechanism layered on the same click counter, isn't it? (I haven't had to do something like this in a very long time)
Now he has to go and re-read his homework for the weekend...
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Indeed it is - but I like to help them to realise that they should think the problem through some more.
|
|
|
|
|
the number of times the banner is clicked.
|
|
|
|
|
Store the number somewhere and increment when clicked. Again, what difficutlties are you having?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
A simple table in a database and an incrementing update statement will do nicely then.
|
|
|
|
|
|
hello,
I want code in asp.net using c# for web application searching in the database for articles.
for example: the sql server database contain columns for (Title, SubTitle, Author, Category, Date, Lead, Body, ImageURL,...) for the articles...
and I want to make web form which can search in this database with more option where user can search by Title, SubTitle, Author, Category, Date, and so on....
can I get help, pls...
I use linq technique
I made these files
Searhc.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Templates/Level_Two.master"
AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="Admin_CMS_Article_Search" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<style type="text/css">
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td height="15">
</td>
</tr>
<tr>
<td class="Searchby" height="50">
Search by Article Name:
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" class="style1">
<tr>
<td width="100">
</td>
<td>
<asp:TextBox ID="txtSearch" runat="server" Width="396px"></asp:TextBox>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="30">
</td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" class="style1">
<tr>
<td width="250">
</td>
<td>
<asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
<asp:GridView ID="grdResults" runat="server" AutoGenerateColumns="False" EnableModelValidation="True"
GridLines="None" ShowFooter="True" OnRowDataBound="grdResults_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<ul class="Titlelist">
<li>
<asp:HyperLink ID="lnkTitle" runat="server">Title</asp:HyperLink>
</li>
</ul>
</td>
</tr>
<tr>
<td class="Leadtxt">
<asp:Literal ID="ltrlLead" runat="server"></asp:Literal>
</td>
</tr>
<tr>
<td>
<hr style="width: 90%; height: 2px;" />
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td align="center">
<asp:Label ID="lblResults" runat="server" CssClass="Leadtxt"></asp:Label>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</asp:Content>
Search.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Admin_CMS_Article_Search : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSearch_Click(object sender, EventArgs e)
{
thedb.islamonlineDataClassesDataContext db = new thedb.islamonlineDataClassesDataContext();
List<thedb.Article> articles = (from art in db.Articles where art.Title.Contains(txtSearch.Text.Trim()) select art).ToList();
grdResults.DataSource = articles;
grdResults.DataBind();
if (articles.Count == 0)
{
lblResults.Text = "Sorry, No Article Found for " + txtSearch.Text.Trim();
lblResults.Visible = true;
}
else
{
lblResults.Visible = false;
}
}
protected void grdResults_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
HyperLink lnkTitle = (HyperLink)e.Row.Cells[0].FindControl("lnkTitle");
Literal ltrlLead = (Literal)e.Row.Cells[0].FindControl("ltrlLead");
lnkTitle.Text = DataBinder.Eval(e.Row.DataItem, "Title").ToString();
lnkTitle.NavigateUrl = "~/Admin/CMS/Article/Show.aspx?id=" + DataBinder.Eval(e.Row.DataItem, "id").ToString();
ltrlLead.Text = DataBinder.Eval(e.Row.DataItem, "Lead").ToString();
}
}
}
so, user can search by Title only... now I want to give user search option by title, date, author, subtitle, body contain...
modified on Saturday, January 1, 2011 9:41 AM
|
|
|
|
|
Please Use "pre" tag to wrapped your code to make it readability.
|
|
|
|
|
thanks RaviRanjankr..
I did it..
|
|
|
|
|
hassanmorsy wrote: I want code in asp.net using c#
It is extremely ride to start demanding code to solve your problem. I doubt you get many responses.
Format your code snippets. Again, you will get few responses if no one can read your question.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
thanks Mark, I finished formating the code.. now it appear more readable...
|
|
|
|