|
When a User Control is loaded into a web form, it becomes part of the WebPage itself. So you need to look at it from that perspective and not from a Design time angle.
That means whatever information is available to Web Form2 can be easily accessed by UC2 too.
Hidden Variables[^]
Query Strings[^]
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
hello
What was known as "Web Control Library" for ASP.NET is no longer continued in VS2005/2008 am I right?
I think I remember I used tree control from the library some years ago...
dev
|
|
|
|
|
Hi folks
I'm just trying to complete a registration sector and for that I've done evrything except for activation email. I know the algorithm and how to do that but my problem is where I can't get a beautiful activation number. I want to write and sql query by which I can select from 3 beggining letters of name, 2 final letters of last name and month and day of registration date and ... (which are enetered in registration form) . So I can make a complicated activation code. you know what do I mean!
my problem would be solved only if you tell me how I can write and handle that sql query for selection.
Thanks alot.
Proper Prepration Prevents Poor Performance! h
|
|
|
|
|
I would use GUIDs for codes to send for activation. SQL generates them natively.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
|
by defining like below in web.config file
<personalization defaultProvider="AspNetSqlPersonalizationProvider">
<providers>
<remove name="AspNetSqlPersonalizationProvider" />
<add name="AspNetSqlPersonalizationProvider" type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider" connectionStringName="SqlServices" />
</providers>
</personalization>
we are able to save the data in sqlserver....any body please give me one example on webparts how to save the in oracle database
|
|
|
|
|
To use Oracle as your Database for personalization, you need to create a custom personalization provider for that.. see the following links for more info:
CUSTOM PERSONALIZATION
http://msdn.microsoft.com/en-us/library/aa479037.aspx
WEB PARTS ORACLE PERSONALIZATION
http://download.oracle.com/docs/html/E10928_01/OraclePersonalizationProviderClass.htm#BABCHDGI
|
|
|
|
|
Hi Friends,
I have used Ajax for paging in my application its work fine but when i click on my page at anywhere its getting a javascript error like top.screenleft is null or not an object when i debug it the error is pointing to ScriptResource.axd file. Please help me to give solution.
Thanks
|
|
|
|
|
Sounds like it's not working fine at all. All we can tell you, is to fix your code. If you want more help, consider telling us if you used AJAX, or if you used a framework that does AJAX, what your code looks like, the actual error ( i.e. the code that the debugger breaks into ) etc.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
When i generate excel in asp.net
it will generate but when i open & then saved this excel it showed
"save as type" "web page".
|
|
|
|
|
harish mehra wrote: when i open & then saved this excel it showed
"save as type" "web page
Yes. That's how web works. What is your question?
|
|
|
|
|
Hard to know exactly what you're doing from this gibberish ( it's not even a question ), but, I suspect you're failing to set the MIME type when you write your file down to the client.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Try this example. I did this in one of my project. I generated the excel after reading the values from a GridView.
STEP 1:Create a function call DownLoad() to download the excel file
private void Download()
{
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.ContentType = "application/vnd.xls";
Response.Charset = "";
this.EnableViewState = false;
System.IO.StringWriter objStringWriter = GenerateExcelBody();
Response.Write(objStringWriter.ToString());
Response.End();
}
STEP 2:Create a function called GenerateExcelBody() to generate the excel boby
private System.IO.StringWriter GenerateExcelBody()
{
System.IO.StringWriter objStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter objHtmlTextWriter = new System.Web.UI.HtmlTextWriter(objStringWriter);
string strVal =string.Empty;
for (int i = 0; i < grEims.Rows.Count; i++)
{
if (i % 2 == 0)
{
strVal += "<tr bgcolor='white'><td>" + grEims.Rows[i].Cells[0].Text + " " + grEims.Rows[i].Cells[1].Text + " " + grEims.Rows[i].Cells[2].Text.ToString() + " " + grEims.Rows[i].Cells[3].Text.ToString() + " " + grEims.Rows[i].Cells[4].Text.ToString() + " " + grEims.Rows[i].Cells[5].Text.ToString() + "</td></tr>" + Environment.NewLine;
}
else
{
strVal += "<tr bgcolor='white'><td>" + grEims.Rows[i].Cells[0].Text + " " + grEims.Rows[i].Cells[1].Text + " " + grEims.Rows[i].Cells[2].Text.ToString() + " " + grEims.Rows[i].Cells[3].Text.ToString() + " " + grEims.Rows[i].Cells[4].Text.ToString() + " " + grEims.Rows[i].Cells[5].Text.ToString() + "</td></tr>" + Environment.NewLine;
}
}
objHtmlTextWriter.WriteLine("<table width='100%'>" +
"<tr><td align=center bgcolor='#ccccff'><h4>List Of Interviews Conducted </h4></td></tr>" +
"<tr><td bgcolor='gray'><b>NO EMP NO. FIRST NAME LAST NAME RECORD RECEIVED ON INTERVIEW</b></td>" +
"</tr>" + strVal + "</table>");
return objStringWriter;
}
STEP 3: Call the Download() function from the control's event you want
e.g.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Download();
}
}
Hope this helps.
Let me know in case of any concern.
Niladri Biswas
|
|
|
|
|
It is useful for generating excel but u can see
when we open that excel and than save this excel
it displayed save as type web page.
can it display default save type as microsoft Excel?
|
|
|
|
|
How can i stop data saved twice when page is refreshed
|
|
|
|
|
|
1. Redirect your page on new location when data is successfully saved when user refresh the page it found new page refreshed which is not contains any sort of data saving code.
2. Clear all the state of controls after data saving and write state check condition before data save but I think first approach is better approach if you found any difficulty then I will send you sample code but remember if user go back to page and repeat same activity then you have to give dynamic image by that you always check random image code before saving same as in yahoo, google.
|
|
|
|
|
you just paste it below your class declaration
private bool _refreshState;
private bool _isRefresh;
public bool IsRefresh
{
get { return _isRefresh; }
}
protected override void LoadViewState(object savedState)
{
object[] allStates = (object[])savedState;
base.LoadViewState(allStates[0]);
_refreshState = (bool)allStates[1];
_isRefresh = _refreshState == (bool)Session["__ISREFRESH"];
}
protected override object SaveViewState()
{
Session["__ISREFRESH"] = _refreshState;
object[] allStates = new object[2];
allStates[0] = base.SaveViewState();
allStates[1] = !_refreshState;
return allStates;
}
and in button click
if (!IsRefresh)
{
//write your code here..
}
|
|
|
|
|
Hi All,
I am creating a job portal in asp.net2.0 and mysql as backend....
I want to create a drop down list.... which displays the list of states according to the country selected in the first dropdownlist by the user..
i have used the sqldatasource and wen i am inserting the following select query => "select statename from state where countryname=@countryname"... its not working for the mysql ... though its working very fine if i use the database as MSSQL ....
Plz help to solve this problem...
Thanks in Advance....
Regards,
Rajan Arora
|
|
|
|
|
You can copy this code from any website for example nokri.com which having all combo of this type but if you need it originally then lot of site provide complete list of same.
Code
1. Just fill all the entry into combo and Enable post back.
2. On Change of first combo fill the sate for country according to country name.
3. Then same for city
Table
CountryName, StateName, CityName
|
|
|
|
|
hi ,
I have a javascript function with 1 parameter[func(val)]
I'm trying to combine that param with some strings to get a regular expression
I tryed this:
var re = new RegExp(val + '.*')
and this:
var re = new RegExp('/' + val + '.*/')
it's not working...
|
|
|
|
|
benams wrote: it's not working...
And what does it has to do with ASP.Net? There is a better place[^](Web Development Forum) at CP for these type of questions.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Could you please explain your problem in a more elegant way?
It will be easy for others to grasp and solve.
Niladri Biswas
|
|
|
|
|
Hi my fellow coders,
I'm trying to HTTP POST some data to a URL (API).
If I directly try on the browser, it works fine and giving the below response:
<?xml version="1.0" encoding="utf-8" ?>
<OUTPUT>
<STATUS>ERROR</STATUS>
</OUTPUT>
But If I use webclient class, the response is different, and is not posting the data at all:
<?xml version="1.0" encoding="utf-8"?>
<OUTPUT><STATUS>HTTP/1.0 200 OK
Content-Type: text/xml
Content-Length: 100
<?xml version="1.0" encoding="utf-8"?>
<OUTPUT><STATUS>SUCCESS</STATUS></OUTPUT></STATUS>
</OUTPUT>
Can my fellow experts give ma a hint on how should I mimic the browser results?
|
|
|
|
|
Give me code by that you are calling web service you are missing something.
You can also do remote debugging for your web service by that you found exact problem for remote debugging just attach process by which you are calling your web service if that is different machine then run webserive and put break point into web service when client call web service automatically execution stop on your break point.
|
|
|
|