|
I want where should I place the Response.Expires?
1. Global.ascx application_srart, application_end, session_start, session_end?
2. Default.aspx.cs Page_Load?
And in case of both should I place before any code or after all codes?
|
|
|
|
|
|
Hi
I am including some code in the web.config file. But I am wondering if i could include those code inside the code behind in ascx or ascx.cs file without writing directly to the web.config file. Is it possible ?
suchita
|
|
|
|
|
Sorry what?
Code should be in your codebehind file (.cs) configuration should be in your configuration file (hence web.config) so could you please rephrase the question?
|
|
|
|
|
i mean the things which we write in web.config file, can we do it from code behind ?
suchita
|
|
|
|
|
|
Is this the way I can avoid conflict between the same application I can call from two different projects and not affect each settings?
For example I have one editor and I am using that editor from different portlets with some modification. So if i not put the information in web.config file about that editor, it wont affect me using that editor in different portlets right ?
suchita
|
|
|
|
|
web.config global to the virtual directory hosting the app. You can make some settings specific to individual folders within the app. If the you have two separate applications, or virtual folders, this will work, but you need to replicate the code between each instance, which adds headaches to maintainability and support.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
yes right. So what would be the best way to get through it ?
suchita
|
|
|
|
|
Without knowing your requirements, intentions, skills, deployment base, etc. it is an impossible question to answer.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
ok. Let me describe one more time. I have an editor which i am using from different portlets and for those different portlets the web.config file is same. But i am using editor with some modifications in those portlets as required. So When I include that key for that editor in web.config, it will be the same for all those editor which is what i wanted to avoid. So I am asking Is there any way to avoid this? Is there anyway i can do in code behind? Or is there any good smart way to do this? What are my options and which one will be the best way to do this ? Right now i am keeping this in web.config file.
suchita
|
|
|
|
|
Are you a developer? Can you write code?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I am still learning.
suchita
|
|
|
|
|
SayamiSuchi wrote: I am still learning.
Very Nice !!!
|
|
|
|
|
Of course you can do it from code behind, you can do just about anything form code-behind you don't need a web.config for such things. Adjust the settings based on the URL the user is using. Store configuration in a database. You have a number of options that depend on many things; requirements, usage, storage medium, extensibility, there is no simple answer.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
plz i want help me
i want connect web pages with google earth
i make project web directory used asp.net and i want connect with google earth
if clicke linke any places i saved information in data base about it
show in the google earth
i want how to connect and i want What are the processes that must to do it?
what the file or code i need to it????
plz help me any thing
|
|
|
|
|
Did you even...try looking at the google earth API section?
is a starting point
Yes, it's js but you can pass that back to the server and then do all the database backend stuff you want.
|
|
|
|
|
No I will not enter into direct email conversation with you, I can provide aid and guidance but I cannot work on the code itself with you, you are better off providing clarity on what you have tried, where it has failed and what you are stuck on here so others can provide their input.
I am replying here because i do not to share my email address.
|
|
|
|
|
<%@ Page Language="C#" MasterPageFile="~/SLS.Master" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="QuickStart.aspx.cs" Inherits="SLS.QuickStart" Title="SLS - Quickstart" %>
<%@ Register Src="Controls/UserReports.ascx" TagName="UserReports" TagPrefix="uc1" %>
<%@ Register Src="Controls/AdvancedSearch.ascx" TagName="AdvancedSearch" TagPrefix="uc1" %>
<%@ Register Src="Controls/Submit.ascx" TagName="Submit" TagPrefix="uc1" %>
<%@ Register Src="Controls/MySLS.ascx" TagName="MySLS" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxToolkit" %>
<%@ Register Src="Controls/Search.ascx" TagName="Search" TagPrefix="uc1" %>
<%@ Import Namespace="SLS.DAL" %>
<%@ Import Namespace="System.Configuration" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div class="HelpLink" style="padding-left:750px;padding-top:4px;"><a target="_blank" href="Help/SLS_HELP.htm">Help Me!</a></div>
<script>
var searchPage="VivisimoSearch.aspx";
//When the active tab changes
function ActiveTabChanged(sender, e) {
var text="SLS - " +sender.get_activeTab().get_headerText();
window.parent.document.title=text;
document.getElementById('<%=AdvancedSearch1.ClientID%>_hidtxtFind').value = "0";
if(sender.get_activeTab().get_tabIndex()!=5){
var tabBehavior=document.getElementById('<%=TabContainer1.ClientID%>').control;
tabBehavior.removeCssClass("CustomTabStyle1");
tabBehavior.addCssClass("CustomTabStyle");
tabBehavior._tabs[5]._hide(true);
}
//SLS-116 :- Google analytics
GoogleTrackPage(sender.get_activeTab().get_headerText());
}
//Google Analytics to grab the page
function GoogleTrackPage(tab){
//when we are on the 5th tab in that case (tab = "")
//So we are not recording the url here
//in the 5th tab ViewReport.aspx gets loaded
//so we are placing the google anatylitcs user control there to track the url
if(tab != ""){
var appName = '<%= Util.GetConfigValue("ApplicationName") %>';
var gaTrackingId = '<%= Util.GetConfigValue("GATrackingCode") %>';
var pageTracker = _gat._getTracker(gaTrackingId);
pageTracker._trackPageview(appName + "/QuickStart.aspx/" + tab);
}
}
//Edit a search
function editSearch(searchId){
//Get the tabBehavior object
if(searchId!="-1"){
var tabBehavior=document.getElementById('<%=TabContainer1.ClientID%>').control;
//Go to the third tab (Submit)
tabBehavior.set_activeTabIndex(2);
//Set the value in the txtReportID textbox on the CreateSavedSearch.ascx interface.
var tb=document.getElementById('<%=Submit1.ClientID%>_txtReportId');
tb.value=searchId;
//Click the button to edit the search.
var btn=document.getElementById('<%=Submit1.ClientID%>_cmdReload');
Page_ValidationActive=false;
btn.click();
}
}
function fnViewAuthor(userId){
sURL="ViewAuthor.aspx?userId=" + userId;
var win=window.open(sURL,'EditsearchForm','scrollbars=yes,resizable=yes,width=430,height=380');
win.focus();
}
function fnViewReport(reportId){
var tabBehavior=document.getElementById('<%=TabContainer1.ClientID%>').control;
//Go to the sixth tab (ViewReport)
//document.getElementById('<%=TabPanel6.ClientID%>').disabled =false;
tabBehavior.removeCssClass("CustomTabStyle");
tabBehavior.addCssClass("CustomTabStyle1");
tabBehavior.set_activeTabIndex(5);
var frmframeReport = document.getElementById('<%=frameReport.ClientID%>');
frmframeReport.src ="Test.htm";
frmframeReport.src="ViewReport.aspx?reportID=" + reportId;
}
function fnLoadSearch(){
var frmframeReport = document.getElementById('<%=frameReport.ClientID%>');
frmframeReport.src="";
frmframeReport.src=searchPage;
}
function fnLoadSearchResult(_find,_search){
if(_search == undefined){
_search = '';
}
var tabBehavior=document.getElementById('<%=TabContainer1.ClientID%>').control;
tabBehavior.removeCssClass("CustomTabStyle");
tabBehavior.addCssClass("CustomTabStyle1");
tabBehavior.set_activeTabIndex(5);
var frmframeReport = document.getElementById('<%=frameReport.ClientID%>');
frmframeReport.src="";
frmframeReport.src=searchPage+"?find=" + _find + "&search_MR=" + _search;
}
//function SetDateRangeSearchControl(searchPeriodText){
//get the Search control in quick search control
//var ddlList=document.getElementById('<%=Search1.ClientID%>_ddlSearchPeriod');
//ddlList.options[ddlList.selectedIndex].text=searchPeriodText;
//get the Search control in MYSLS control
//var ddlsearchCtrl=document.getElementById('<%=MySLS.ClientID%>_Search1_ddlSearchPeriod');
//ddlsearchCtrl.options[ddlsearchCtrl.selectedIndex].text=searchPeriodText;
//}
function fnSubmit(){
var tabBehavior=document.getElementById('<%=TabContainer1.ClientID%>').control;
//Go to the third tab (Submit)
tabBehavior.set_activeTabIndex(2);
//Set the value in the txtReportId textbox on the Submit.ascx interface.
var tb=document.getElementById('<%=Submit1.ClientID%>_txtReportId');
tb.value=0;
//Click the button to get the report
var btn=document.getElementById('<%=Submit1.ClientID%>_cmdReload');
btn.click();
}
function fnSearchTip(){
sURL="SearchTip.aspx";
var win=window.open(sURL,'searchTip','scrollbars=yes,resizable=yes,width=620,height=600');
win.focus();
}
function fnAdvanceSearch(){
var tabBehavior=document.getElementById('<%=TabContainer1.ClientID%>').control;
//Go to the second tab (advanced search)
tabBehavior.set_activeTabIndex(1);
}
function fnMySLS(){
var tabBehavior=document.getElementById('<%=TabContainer1.ClientID%>').control;
//Go to the last tab (mysls)
tabBehavior.set_activeTabIndex(4);
}
function ReloadSavedSearches(){
//SLS-76
//This below two statements will again load the VivisimoSearch.aspx again
// If we do not do that first time when user save a search this function gets called from VivisimoSearch.aspx
// after calling this function we set window.clearInterval(interval) in VivisimoSearch.aspx which stop looping the checkForMessages function in VivisimoSearch.aspx
//so again have to reload the VivisimoSearch.aspx
var frmframeReport = document.getElementById('<%=frameReport.ClientID%>');
frmframeReport.src=searchPage;
//Click the button
var btn=document.getElementById('<%= cmdReloadSearch.ClientID%>');
btn.click();
}
function fnLoadSearches(searchID){
var tabBehavior=document.getElementById('<%=TabContainer1.ClientID%>').control;
//Go to the tab (Advanced search)
tabBehavior.set_activeTabIndex(1);
var txtSearchID=document.getElementById('<%=AdvancedSearch1.ClientID%>_hidtxtSearchID');
txtSearchID.value = searchID;
//Click the button to get the search
var btn=document.getElementById('<%=AdvancedSearch1.ClientID%>_cmdLoadSearch');
btn.click();
}
function fnGetReport(userID){
if(userID!=""){
//Set the value in the txtUserID textbox on the MYSLS.ascx interface.
var tb=document.getElementById('<%=MySLS.ClientID%>_txtUserId');
tb.value=userID;
//Click the button to get the report
var btn=document.getElementById('<%=MySLS.ClientID%>_cmdReload');
btn.click();
}
}
// Added frame to simulate download prossess of attachment
// without opening new Window
function downloadLink(link){
var downloadFrame = document.getElementById('downloadFrame');
downloadFrame.src = link;
var but = document.getElementById('<%=cmdReloadCount.ClientID %>');
but.click();
return;
}
function fnBookmarkReportIDs(bookmarkReportIDs){
//Click the button to get the report
var tb=document.getElementById('<%=MySLS.ClientID%>_txtbookmarReportIDs');
tb.value=bookmarkReportIDs;
var btn=document.getElementById('<%=MySLS.ClientID%>_cmdReload');
btn.click();
}
function fnReloadTreeView(){
var btn=document.getElementById('<%=MySLS.ClientID%>_cmdReloadTree');
btn.click();
}
// window to open who else is interested window
function fnWhoElseInterested(reportId,userId){
if (userId != '' && reportId!=0){
window.open("WhoElseInterested.aspx?reportId="+ reportId + "&userid="+ userId);
}else{
alert("This SLS feature will display who's interested in this report. It will be enabled for this report soon.");
}
}
function fnReloadAdvancedSearch(){
alert("fnReloadAdvancedSearch")
}
// SLS-150
// Function added to refresh the Read View count of reports
// in mysls tab
function RefreshMYSLS(rptCat){
if(rptCat == "View Report"){
var btn=document.getElementById('<%=MySLS.ClientID%>_linkMyReports');
btn.click();
}
}
</script>
<AjaxToolkit:TabContainer ID="TabContainer1" OnClientActiveTabChanged="ActiveTabChanged" runat="server" CssClass="CustomTabStyle" Width="980px">
<AjaxToolkit:TabPanel ID="TabPanel1" runat="server" HeaderText="Quick Start">
<ContentTemplate>
<table width="100%" border=0>
<tr>
<td align="left">
<uc1:Search ID="Search1" runat="server" />
</td>
</tr>
<tr>
<td class=headerBar>Leveraging the Smart Learning System!<br /></td>
<td> </td>
<td class=headerBar>What can I do with the Smart Learning System.</td>
</tr>
<tr>
<td valign=top width=50% align=center>
<asp:UpdatePanel ID="udpContentTypeREfreshQuickStartMsg" runat="server">
<ContentTemplate><br /><asp:Label ID="lblReadReports" runat="server" CssClass="boldText" >1,016 reports Submitted 10,924 reports Viewed in last 30 days</asp:Label><br /><br />
<uc1:UserReports ID="UserReports1" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td> </td>
<td valign=top width=50%>
<p class=blueText><b>Submit</b> a report</p>
Make your valuable knowledge available to others.<br />
<ul style="margin-top ">
<li><img src="Images/word.gif" /> <a target="_blank" href="Documents/slsReportTemplate.doc">Download a report template</a></li>
<li><a href="javascript:fnSubmit();">Submit a report</a> </li>
<li><a href="http://sls.pg.com/sls/reports/256980/ViewReport.ashx">SLS Content Guidelines</a></li>
</ul>
<p class=blueText><b>Search</b> for reports </p>
Find the reports you are interested in.
<asp:UpdatePanel ID="udpContentType1" runat="server">
<ContentTemplate>
<ul style="margin-top ">
<li><a href="javascript:fnSearchTip();">Search Tips</a> </li>
<li><a href="javascript:fnAdvanceSearch();">Advanced Search</a></li>
<li>Saved Searches <asp:DropDownList CssClass=savedSearches ID=ddlSavedSearches OnSelectedIndexChanged="ddlSavedSearches_SelectedIndexChanged" AutoPostBack="true" runat=server/></li>
</ul>
</ContentTemplate>
</asp:UpdatePanel>
<p class=blueText><b>Subscribe</b> to reports through iSubscribe</p>
Be notified by email of new reports you are interested in.
<ul style="margin-top ">
<li><a target="_blank" href="http://isubscribe.pg.com">Subscribe to reports through iSubscribe</a></li>
<li><a target="_blank" href="http://isubscribe.pg.com">View your recent subscription results</a></li>
<li><a target="_blank" href="http://isubscribe.pg.com">Manage your subscriptions</a></li>
</ul>
<p class=blueText><b>Training</b> on how to use SLS.</p>
Learn how to use SLS and its new capabilities
<ul style="margin-top ">
<li><a href="#" onClick="SLRREN = window.open('http://intraprod1.internal.pg.com/technet/tech_dev/sls-training/infomercial/SLSpopGenric.html','SLRrenewalSLS','resizable=yes,width=600,height=400'); SLRREN.focus(); return false;">View an Introduction to SLS (6 min)</a></li>
<li><a href="http://intraprod1.internal.pg.com/technet/tech_dev/sls-training/infomercial/SLS-training.ppt">View the Self-Guided Training (30 min)</a></li>
<li><a href="Documents/SLSQuicksheet.doc">SLS Quick Sheet (1 page)</a></li>
</ul>
</td>
</tr>
</table>
</ContentTemplate>
</AjaxToolkit:TabPanel>
<AjaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="Advanced Search">
<ContentTemplate>
<uc1:AdvancedSearch ID="AdvancedSearch1" runat="server" />
</ContentTemplate>
</AjaxToolkit:TabPanel>
<AjaxToolkit:TabPanel ID="TabPanel3" runat="server" HeaderText="Submit">
<ContentTemplate>
<asp:UpdatePanel ID=pnl runat=server >
<ContentTemplate>
<uc1:Submit ID="Submit1" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</AjaxToolkit:TabPanel>
<AjaxToolkit:TabPanel ID="TabPanel4" runat="server" HeaderText="Personal Networks">
<ContentTemplate>
<%-- <iframe width=100% style="height:600px" frameborder=0 src="http://web03.na.pg.com/PersonalNetworks/ManageNetworks.aspx"></iframe>
--%> <iframe width=100% style="height:600px" frameborder=0 src="http://bdc-intra528.internal.pg.com/iToolsGroupService/Pages/ManageNetworks.aspx"></iframe>
</ContentTemplate>
</AjaxToolkit:TabPanel>
<AjaxToolkit:TabPanel ID="TabPanel5" runat="server" HeaderText="MySLS">
<ContentTemplate>
<table border="0" width="100%">
<tr>
<td align="left">
<uc1:Search ID="Search2" runat="server" />
</td>
</tr>
<tr>
<td align="left">
<uc1:MySLS ID="MySLS" runat="server" />
</td>
</tr>
</table>
</ContentTemplate>
</AjaxToolkit:TabPanel>
<AjaxToolkit:TabPanel ID="TabPanel6" runat="server" Enabled=false Width="1">
<ContentTemplate>
<iframe id="frameReport" style="margin " frameborder=no scrolling="auto" width="100%" height="900" src="" runat="server" ></iframe>
</ContentTemplate>
</AjaxToolkit:TabPanel>
</AjaxToolkit:TabContainer>
<asp:UpdatePanel ID=updateFrame runat=server >
<ContentTemplate>
<asp:Button ID="cmdReloadSearch" runat="server" CssClass="hidden" CausesValidation="false" OnClick="cmdReloadSearch_Click"/>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID=updateCountOnQuickStart runat=server >
<ContentTemplate>
<asp:Button ID="cmdReloadCount" runat="server" CssClass="hidden" CausesValidation="false" OnClick="cmdReloadCount_Click"/>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID=cmdRefine runat=server CssClass="hidden" CausesValidation="false" OnClick="cmdRefine_Click" />
<asp:Button ID="btnViewReport" runat="server" CssClass="hidden" CausesValidation="false" OnClick="btnViewReport_Click"/>
<iframe id="downloadFrame" style="display: none"></iframe>
</asp:Content>
|
|
|
|
|
So, what is your question???
Cheers,
Karthik
|
|
|
|
|
Dear Experts,
I want to secure my application so i need to Disable Status Bar so that when mouse kept on the link it wont display the informations in the Status Bar.
Thanks in advance
|
|
|
|
|
You can use javascript to do this, but how on earth do you think this will secure your application in any way?
|
|
|
|
|
You can't disable the status bar on the main window unless you have used window.open to create. You can use JavaScript to set the statusbar text for the link to be empty
<a href="..." onMouseOver="status.text=''">
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
... onmouseover="self.status=''; return true;" ...
FTFY
Downvote it all you like, the fact remains my "correction" is correct and (no offence meant, but) Mark's snippet was not.
modified on Monday, September 27, 2010 1:08 PM
|
|
|
|
|
Use javascripts it will hide it. I think hiding it is what you mean secure
|
|
|
|